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

Removes AWS_FATAL_ASSERT in s_aws_event_loop_group_shutdown_async #515

Merged
merged 2 commits into from
Sep 7, 2022

Conversation

waahm7
Copy link
Contributor

@waahm7 waahm7 commented Sep 6, 2022

Issue #, if available: aws/aws-sdk-cpp#1809

Description of changes:

  • Removes fatal assert in s_aws_event_loop_group_shutdown_async

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -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);
Copy link
Contributor Author

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);
Copy link
Contributor Author

@waahm7 waahm7 Sep 6, 2022

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.

Copy link
Contributor

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.

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