-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[Observability / Doc] Add support of ray debugger on windows #44902
Comments
Nice, I came here to propose my own very similar fix to the _connect_pdb_client function, i've been using a locally patched version for a few weeks and have not found an issue. I'm glad to see a windows fix come in. |
Hi @OpenCoderX, Have you tried my solution on your Windows PC? This modified function works on my computer, but I am not sure about the others. Regards, JL |
I'll test your version. |
@mattip this seems related to the rpdb cross platform problem we discussed earlier in the morning; can you confirm? than prioritize to work on it after the 3-4 items we discussed. |
The suggested change is this, which should also fix the previously mentioned #37145. I will turn this into a PR. Is this code tested? diff --git a/python/ray/util/rpdb.py b/python/ray/util/rpdb.py
index e6a9769966..c5979d2c88 100644
--- a/python/ray/util/rpdb.py
+++ b/python/ray/util/rpdb.py
@@ -338,16 +338,24 @@ def _post_mortem():
def _connect_pdb_client(host, port):
+ if sys.platform == 'win32':
+ import msvcrt
+
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
while True:
# Get the list of sockets which are readable.
- read_sockets, write_sockets, error_sockets = select.select(
- [sys.stdin, s], [], []
+ if sys.platform == 'win32':
+ ready_to_read = select.select([s], [], [], 1)[0]
+ if msvcrt.kbhit():
+ ready_to_read.append(sys.stdin)
+ else:
+ ready_to_read, write_sockets, error_sockets = select.select(
+ [sys.stdin, s], [], []
)
- for sock in read_sockets:
+ for sock in ready_to_read:
if sock == s:
# Incoming message from remote debugger.
data = sock.recv(4096) |
merge it! :) @mattip |
This is tested in |
Description
According to https://discuss.ray.io/t/solution-found-using-rays-debugger-on-windows/14474, users need to modify the source code for ray debugger to work on windows.
Link
No response
The text was updated successfully, but these errors were encountered: