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

fix net_plugin_impl destruction order: destroy thread_pool's executor after users of it #2300

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

spoonincode
Copy link
Member

net_plugin_impl currently destroys its named_thread_pool before a number of users of it such as expire_timer. Those users can, and do, access their executor on their destruction which in this case is accessing an already destroyed executor.

Move the named_thread_pool up to the top so it's destroyed last. A nice side effect of this is being able to clean up a number of the unique_ptrs to just being a plain member.

if( keepalive_timer )
keepalive_timer->cancel();
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't see a reason for these cancellations. The timers will effectively be stopped once the named_thread_pool is stopped.

Copy link
Member

@heifner heifner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Move net_plugin_impl to be destroyed last, this simplifies code and resolves consumers trying to access it after destruction.
Note:end

Base automatically changed from ub_grab_bag to main March 12, 2024 16:48
@spoonincode spoonincode merged commit 96fb8a4 into main Mar 12, 2024
60 checks passed
@spoonincode spoonincode deleted the net_plugin_dtor_order branch March 12, 2024 16:48
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.

4 participants