-
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
Cache the Error Before Any Side Effects #619
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,12 +165,16 @@ static struct aws_event_loop_group *s_event_loop_group_new( | |
|
||
return el_group; | ||
|
||
on_error: | ||
on_error:; | ||
/* cache the error code to prevent any potential side effects */ | ||
int cached_error_code = aws_last_error(); | ||
|
||
aws_mem_release(alloc, usable_cpus); | ||
s_aws_event_loop_group_shutdown_sync(el_group); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is one of those throwing some new error because it cant clean up correctly? should we fix that as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's code in here that loops through a priority list until it raises the AWS_ERROR_PRIORITY_QUEUE_EMPTY, indicating it's empty. So it's not an error-as-fail, it's an error-code-as-flow-control |
||
s_event_loop_group_thread_exit(el_group); | ||
|
||
/* raise the cached error code */ | ||
aws_raise_error(cached_error_code); | ||
return NULL; | ||
} | ||
|
||
|
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.
; _ ;