Skip to content

Conversation

@unclepomedev
Copy link

@unclepomedev unclepomedev commented Nov 15, 2025

Issue

#196

Description

I updated the implementation to use the port range recommended by IANA, and also added a retry mechanism for cases where a RuntimeError occurs.

https://www.rfc-editor.org/rfc/rfc6335

debugpy.listen(("localhost", port))
break
except OSError:
except (OSError, RuntimeError):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the RuntimeError error in this PR?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mateusz-Grzelinski

According to the traceback in the linked issue, a RuntimeError is raised when the specific port is unavailable, so I've updated the code to catch it.

However, I am concerned that RuntimeError is too generic. Catching it might trigger the retry loop for errors unrelated to the port issue. To mitigate this, I suggest adding a maximum retry limit. What do you think?

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

Successfully merging this pull request may close these issues.

2 participants