Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processes only start working after checking status #68

Closed
chenxi-shi opened this issue Feb 13, 2018 · 7 comments
Closed

Processes only start working after checking status #68

chenxi-shi opened this issue Feb 13, 2018 · 7 comments

Comments

@chenxi-shi
Copy link

When using
subprocess.Popen(["jug", "execute", "exmp.py"], stderr=STDOUT, creationflags=CREATE_NEW_CONSOLE)
runing jug process, the subprocess will only starts after checking status.
The same thing happens when running by
subprocess.Popen(["jug", "execute", "exmp.py"], stderr=STDOUT, shell=True)

This problem doesn't appear when using
subprocess.Popen(["jug", "execute", "exmp.py"], stderr=STDOUT)

Would you mind to help?

@luispedro
Copy link
Owner

I find it very surprising that there is a difference between these. What exactly do you mean by "checking status"?

Can you add the --verbose=info flag and see what happens?

@chenxi-shi
Copy link
Author

Thank you for replying!
My "checking status" means the execution of "jug status exmp.py".

The subprocess code is in a file called "call_exmp.py", and the following is the print and I bold the time for your reference.

\Jug_task>python call_exmp.py
call_exmp starts: 1518618461.5917778
process 9244: ['jug', 'execute', 'exmp.py', '--will-cite', '--verbose=INFO', '--debug']
process 4060: ['jug', 'execute', 'exmp.py', '--will-cite', '--verbose=INFO', '--debug']
process 11384: ['jug', 'execute', 'exmp.py', '--will-cite', '--verbose=INFO', '--debug']
process 12916: ['jug', 'execute', 'exmp.py', '--will-cite', '--verbose=INFO', '--debug']
\Jug_task>jug status exmp.py
Start: 1518618481.4294322
Spend 0.0019981861114501953
Waiting Ready Finished Running Task name
.................................................................................................
0 3 0 2 exmp.do_something
1 0 0 0 exmp.join
.................................................................................................
1 3 0 2 Total
C:\Mywork\tasks\Jug_task>

Here is the verbose information on one process.

Start: 1518618481.130434
Spend 0.006001472473144531
INFO:root:Execute start (6 tasks)
INFO:root:Executing exmp.do_something...
0 Finished
INFO:root:Already in execution exmp.do_something...
INFO:root:Already in execution exmp.do_something...
INFO:root:Already in execution exmp.do_something...
INFO:root:Executing exmp.do_something...
6.343236446380615sec - Process 4: 1
7.344218969345093sec - Process 4: 2
8.34446907043457sec - Process 4: 3
9.345445156097412sec - Process 4: 4
4 Finished
INFO:root:Executing exmp.join...
___________________________This is join

I will also attach my test code in another comment for your reference.

@chenxi-shi
Copy link
Author

Here are the screenshots of files
call_exmp.py
call_exmp
exmp.py
exmp

Thanks!

@chenxi-shi
Copy link
Author

Updating:

This problem will be solved when I add process.poll(). It is like checking process would trigger the tasks' starting.

@luispedro
Copy link
Owner

Sorry, I cannot be more constructive, but I don't see why it shouldn't work as expected or why process.poll() would make a difference. If it's a windows thing then I cannot really help, though.

@chenxi-shi
Copy link
Author

I am working on Windows. It doesn't matter since I could just use process.poll() to trigger processes. Thanks.

@luispedro
Copy link
Owner

Closing as I don't feel I have enough information to fix any underlying issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants