-
Notifications
You must be signed in to change notification settings - Fork 61
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
Removes AWS_FATAL_ASSERT in s_aws_event_loop_group_shutdown_async #515
Conversation
@@ -63,16 +63,14 @@ static void s_aws_event_loop_group_shutdown_async(struct aws_event_loop_group *e | |||
struct aws_thread cleanup_thread; | |||
AWS_ZERO_STRUCT(cleanup_thread); | |||
|
|||
AWS_FATAL_ASSERT(aws_thread_init(&cleanup_thread, el_group->allocator) == AWS_OP_SUCCESS); | |||
aws_thread_init(&cleanup_thread, el_group->allocator); |
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.
This always return Success.
AWS_FATAL_ASSERT( | ||
aws_thread_launch(&cleanup_thread, s_event_loop_destroy_async_thread_fn, el_group, &thread_options) == | ||
AWS_OP_SUCCESS); | ||
aws_thread_launch(&cleanup_thread, s_event_loop_destroy_async_thread_fn, el_group, &thread_options); |
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.
This can only fail if we cannot create a thread. As the function is void, we cann’t return an AWS_OP_ERR without changing the return type. We use this function as a completion call back during aws_ref_count_init at https://github.com/awslabs/aws-c-io/blob/main/source/event_loop.c#L116 which expects the return type to be void.
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.
If this fails and shutdown is blocking (aws_thread_join_all_managed is used without a timeout) then it will be an indefinite wait.
Issue #, if available: aws/aws-sdk-cpp#1809
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.