Skip to content
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

A patch for asyncio.tasks.wait_for for Python 3.8-3.11 #7572

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

kozlovsky
Copy link
Collaborator

The patch fixes #7570 by monkey-patching asyncio.tasks.wait_for with a version that did not suppress CancelledError. Also, the patched version adds base_lost_result_handler that writes an error if a result of a completed task is lost due to a race condition. Right now, I don't think we have some lost resources due to the original wait_for bug, but later we can override base_lost_result_handler to properly close such resources if necessary.

@synctext
Copy link
Member

Impressive as always! Just a question to understand how 'deep' this is.
How much time would it take to try to test base_lost_result_handler within our application tester infrastructure. For instance, letting it run for a week with a modified Tribler core or IPv8 test community with multiple asyncio.tasks.wait_for stress testers. If its more than a day of work, I guess we should be focusing on fixing the production errors that Tribler clients are sending us.

@kozlovsky
Copy link
Collaborator Author

@synctext I think setting up the stress testing should require a day of work. I'd like first to spend a day fixing the broken metrics collection and dashboard, and then I can do the stress testing.

@synctext
Copy link
Member

OK, then it's a lot of your time. Lets try to get a stable release this week this month...

@kozlovsky kozlovsky force-pushed the fix/wait_for branch 3 times, most recently from 96a8404 to 5480455 Compare August 16, 2023 05:51
@kozlovsky kozlovsky marked this pull request as ready for review August 16, 2023 09:08
@kozlovsky kozlovsky requested a review from a team as a code owner August 16, 2023 09:08
@kozlovsky kozlovsky requested review from drew2a and removed request for a team August 16, 2023 09:08
@kozlovsky kozlovsky merged commit 080f23d into Tribler:main Aug 16, 2023
17 checks passed
@kozlovsky kozlovsky deleted the fix/wait_for branch August 16, 2023 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants