Draft
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
sbSteveK
approved these changes
Dec 20, 2022
waahm7
approved these changes
Dec 20, 2022
TingDaoK
approved these changes
Dec 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
Crashes in aws-crt-python if a WebSocket outlived an EventLoopGroup.
Investigation:
aws_channelis refcounted. It uses anaws_event_loop, but event loops do not currently support refcounting.The
aws_event_loop_groupis refcounted, butaws_channelonly currently knows about an individual loop.So it's possible for the refcount on aws_event_loop_group to go to 0, and all the loops are destroyed, before the channel's refcount goes to zero, and it tries to schedule a task on the loop, and everything explodes because the loop was already cleaned up
Description of changes:
Add new function
aws_event_loop_group_acquire_hold_on_group(struct aws_event_loop *);so that channel can refcount the group, even though it only has access to the individual loopI considered adding a proper refcount to individual the aws_event_loop, but there's a good bit of code that assumes the lifetime of the loops is tied to the lifetime of the group, so I didn't want to break that assumption.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.