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

Support for debugging python multiprocessing #653

Open
pperanich opened this issue Aug 11, 2022 · 0 comments
Open

Support for debugging python multiprocessing #653

pperanich opened this issue Aug 11, 2022 · 0 comments

Comments

@pperanich
Copy link

Hi, I am trying to use dap-mode with debugpy to debug a simple python multiprocessing script. While the debugger seems responsive to breakpoints and debug navigation in the main process, the child process can never be reached. I will provide a simple test script below to demonstrate.

import multiprocessing
import traceback
import sys
import time

def sub_job_test():
    global trace_back_msg
    wait_time = 3 #random.randrange(0,13)
    time.sleep(wait_time)
    print("sub_job_test()")
    try:
        if wait_time < 4:
            raise FileExistsError
    except:
        trace_back_msg= "".join(traceback.format_exception(*sys.exc_info()))

if __name__ == "__main__":
    proc = multiprocessing.Process(target=sub_job_test)
    start_time = time.time()
    timeout = 7
    proc.start()
    proc.join(timeout=timeout)
    proc.terminate()

Lastly, I did try adding :subProcess t to my debugging configuration template, but this did not change the behaviour. See here for motivation.

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

1 participant