This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
ptvsd hangs on subprocess.Process.join #1036
Comments
If you do this: from multiprocessing import Process
def run():
print("RUN")
if __name__ == "__main__":
multiprocessing.set_start_method('spawn') # note this line
p = Process(target=run)
p.start()
print("JOIN")
p.join(5.0) # wait for 5 secs to let the process finish
print(p.is_alive()) # should be False Does it work for you on 3.6? (Note that the |
That works, thanks! But doesn't that disable CoW on Linux?
…On Mon, Nov 19, 2018 at 4:11 PM Pavel Minaev ***@***.***> wrote:
If you do this:
from multiprocessing import Process
def run():
print("RUN")
if __name__ == "__main__":
multiprocessing.set_start_method('spawn') # note this line
p = Process(target=run)
p.start()
print("JOIN")
p.join(5.0) # wait for 5 secs to let the process finish
print(p.is_alive()) # should be False
Does it work for you on 3.6?
(Note that the __main__ thing is necessary in any case if your want your
code to be portable to Windows.)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1036 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHpXsUz2WmYB2dttqSs8oFbsg0fQfnvGks5uwsoegaJpZM4YpLm7>
.
|
It disables We don't support multiprocessing with fork currently - #943 tracks this feature, so I'll close this one as a dupe. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Environment data
Python 3.6.6, Anaconda 2.7.13, Python 2.7.16
Actual behavior
Subprocess code gets never executed
Subprocess remains alive after 5 seconds
On Python2, the debugged main process never terminates either
Expected behavior
Subprocess code to be executed and to terminate immediately
This happens for all three Python versions if the entire code is executed directly
Steps to reproduce:
The text was updated successfully, but these errors were encountered: