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

IF: Shutdown thread pool in controller destructor #2190

Merged
merged 4 commits into from
Feb 6, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Feb 2, 2024

After discussing #2185 with @greg7mdp decided to move the shutdown of the controller_impl thread pool to the controller destructor. The real issue here, I believe, is that we have a circular reference between controller <-> controller_impl. I think we should break that circular reference, but until we do, this seems like a much safer approach.

This PR takes a step in the direction of removing controller_impl::self. It moves the signals to controller_impl and provides accessors on controller. It also removes all internal controller uses of self except for passing it on to transaction_context. Changing transaction_context and apply_context to use controller_impl instead of controller is a bigger change left for later. This PR does make the breaking change of signals being accessors instead of direct members on controller. Since we have changed what many of the signals emit in 6.0, seems like a good time to make this interface change. The removal of usage of self in transaction_context and apply_context can happen later without impacting external users of controller.

Depends on: AntelopeIO/reference-contracts#50 for the libtester tests.

@heifner heifner added the OCI Work exclusive to OCI team label Feb 2, 2024
@ericpassmore
Copy link
Contributor

ericpassmore commented Feb 4, 2024

Note:start
group: IF
category: INTERNALS
summary: Better management of controller_impl thread pool.
Note:end

@heifner heifner requested a review from greg7mdp February 6, 2024 14:45
@heifner heifner marked this pull request as ready for review February 6, 2024 14:46
@heifner heifner requested a review from linh2931 February 6, 2024 14:46
Copy link
Member

@linh2931 linh2931 left a comment

Choose a reason for hiding this comment

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

Nice clean up!

Copy link
Contributor

@greg7mdp greg7mdp left a comment

Choose a reason for hiding this comment

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

can you remove the member controller& self; at line 793?

@heifner
Copy link
Member Author

heifner commented Feb 6, 2024

can you remove the member controller& self; at line 793?

Not without the refactor of transaction_context and apply_context as it is passed in on every transaction execution.

@heifner heifner merged commit 4e92a59 into hotstuff_integration Feb 6, 2024
26 checks passed
@heifner heifner deleted the controller-self branch February 6, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants