You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow "request": "attach" and "autoReload": to auto-reload code in remote service #1874
I would like to use debugpy to diagnose issues and try potential solutions in a running service. autoReload appears to be mutually exclusive with "request": "attach", only allowed if "request": "launch".
Is this a hard limitation that will never be possible?
Some of the services to be debugged are serving control systems for hardware on specific Kubernetes nodes, so using something like Telepresence to proxy traffic to a local instance of the service is not practical.
Ideally, launching with "request": "attach" and autoReload would connect to the service, allow live code changes and on disconnect return the code to its initial state. Any code changes are preserved on the developer machine and can be re-deployed, leaving the running service in an unknown state for the minimum amount of time.
Snapshot of Intellisense telling me that autoReload is not allowed.
What you're asking for is reload on attach, which I'm not sure why it isn't supported. Seems like it could be. Essentially there's a thread in the debugger that's just sitting there waiting for file change notifications. It then attempts to reload the affected module. Not sure why that wouldn't work during attach.
The putting everything back on detach would be iffy though. Reload doesn't always work. What if you made a change and it couldn't be put back?
Activity
rchiodo commentedon Mar 21, 2025
Reload is tricky, you can read more about it here (debugpy basically does the same thing as xreload):
https://github.com/JayfonLin/xreload
What you're asking for is reload on attach, which I'm not sure why it isn't supported. Seems like it could be. Essentially there's a thread in the debugger that's just sitting there waiting for file change notifications. It then attempts to reload the affected module. Not sure why that wouldn't work during attach.
The putting everything back on detach would be iffy though. Reload doesn't always work. What if you made a change and it couldn't be put back?
rchiodo commentedon Mar 21, 2025
Transferring to a discussion item