PyDev.Debugger icon indicating copy to clipboard operation
PyDev.Debugger copied to clipboard

Add support for `pydevd --continue` to allow launching an app without pausing

Open briandealwis opened this issue 3 years ago • 5 comments

This PR adds a new flag to pydevd, --continue, to start the application without waiting for the debugger connection. @etanshaul has been testing this with PyCharm with good results.

I didn't find an obvious place to create a test around this and would appreciate a pointer for how to proceed.

Fixes #161

briandealwis avatar May 17 '21 16:05 briandealwis

Hi Brian, can you elaborate a bit on when you'd use this?

i.e.: In general this wouldn't be a good idea as it'd add the possibility of missing breakpoints until those are actually sent from the client, so, I'm curious on the use case here...

fabioz avatar May 20 '21 17:05 fabioz

Sorry Fabio, this got lost in my inbox.

At its essence, we're interested in supporting debugging of Python micro-services as part of a Kubernetes-based application. The scenario is usually around a developer launching the app in a development environment, such that they control how inputs are fed into the system; it's not for live-debugging of a production or staging environment. So the developer is usually in control over initiating requests of the application, so the risk of missing breakpoint scenarios is small.

Kubernetes has various readiness and liveness requirements for services, so a container that is paused waiting for a debugger to connect and resume execution can trigger a ripple effect across the system.

briandealwis avatar Jun 07 '21 03:06 briandealwis

Hi @fabioz — is it possible to get this committed?

briandealwis avatar Aug 26 '21 21:08 briandealwis

Sorry for the delay... this got lost on my side too :(

Would it be ok for you to rename the argument from --continue to --no-wait?

-- I think --no-wait signals that it's not waiting for breakpoints to be sent by the client before proceeding the execution a bit better than --continue.

Also, can you create one test-case for this (to make sure that it won't break going further)? -- the related test should be in test_debugger.py -- you may need a custom fixture to customize the arguments (i.e.: tests_python.debugger_fixtures).

fabioz avatar Aug 27 '21 13:08 fabioz

p.s.: if you need more pointers on the test case, please let me know.

fabioz avatar Aug 27 '21 13:08 fabioz