Add ability to attach, detach and attach once again#287
Add ability to attach, detach and attach once again#287DonJayamanne wants to merge 16 commits intomicrosoft:masterfrom
Conversation
ptvsd/wrapper.py
Outdated
| # print(s) | ||
| #ipcjson._TRACE = ipcjson_trace | ||
| def ipcjson_trace(s): | ||
| with open('/Users/donjayamanne/Desktop/Development/vscode/my_forked_ptvsd/ptvsd/log.log', 'a') as file: |
There was a problem hiding this comment.
Temporary debugging code 😃
ptvsd/wrapper.py
Outdated
|
|
||
| if addhandlers: | ||
| _add_atexit_handler(proc, server_thread) | ||
| _set_signal_handlers(proc) |
There was a problem hiding this comment.
I'm going to have to modify _set_signal_handlers to close all VS Code message processors.
ptvsd/wrapper.py
Outdated
| client, _ = server.accept() | ||
| _add_socket_handler(client, pydevd, 'ptvsd.Server', killonclose=True, addhandlers=False) | ||
|
|
||
| connection_thread = threading.Thread(target=_wait_for_more, name='ptvsd_client_connection') |
There was a problem hiding this comment.
New thread that'll ensure we support more than one client.
@int19h When speaking to Karthik the question about limiting multiple concurrent client connections came up.
Should we have a limit on the number of concurrent connections, to just one?
There was a problem hiding this comment.
Yes. We never supported anything more than that before, and just thinking of all the possibilities of things going wrong in that scenario makes my head hurt. :)
DonJayamanne
left a comment
There was a problem hiding this comment.
Some comments
ptvsd/wrapper.py
Outdated
| _add_pydevd_event_handler(client, pydevd, name='ptvsd.Server') | ||
|
|
||
| connection_thread = threading.Thread(target=_wait_for_more_connections, | ||
| name='ptvsd_client_connection') |
There was a problem hiding this comment.
Use ptvsd.Client.Connection as name, to be consistent with other ptvsd thread names
ptvsd/wrapper.py
Outdated
| """ | ||
| client = _create_client() | ||
| client.connect((host, port)) | ||
| pydevd = PydevdSocket() |
|
@ericsnowcurrently
|
Codecov Report
@@ Coverage Diff @@
## master #287 +/- ##
==========================================
+ Coverage 57.4% 57.64% +0.23%
==========================================
Files 10 10
Lines 1850 1891 +41
==========================================
+ Hits 1062 1090 +28
- Misses 788 801 +13
Continue to review full report at Codecov.
|
|
Closing in favor of #296 |
@int19h @ericsnowcurrently @karthiknadig
The code is far from complete., but would like some early feedback on the solution.
With the changes I've made I've managed to get re-attach working, at least on VSC.
Pending - Fix remainder of the code and what ever tests fail
Summary: