-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
proof of concept for deterministic close race #101
Conversation
@@ -808,6 +811,8 @@ def __str__(self): | |||
|
|||
:param event: | |||
''' | |||
self._for_testing_peer_closed_connection.set() | |||
await trio.sleep(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the checkpoint could be eliminated in the common case at the cost of more complexity
def __init__():
...
self._for_testing_peer_closed_connection = None
...
if self._for_testing_peer_closed_connection:
self._for_testing_peer_closed_connection.set()
await trio.sleep(0)
This is an interesting concept, but I wonder if this one execution path deserves special handling? There are other execution paths that race, too. I think I would rather rewrite some of the race-prone code now that I better understand some of the issues involving the reader task (e.g. #90), and then maybe have some kind of connection fuzzing script (a generalization of issue_96.py). Thoughts? |
Placing synchronization hooks at strategic points to induce known race scenarios has the advantage of supporting deterministic test cases. The fuzzing tests can get costly due to combinatorics and required resolution, and seem more appropriate as an offline tool to discover the races. |
449d2e9
to
3ae2587
Compare
No description provided.