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

feat(all):make @PreDestroy work #5421

Merged
merged 2 commits into from
Aug 23, 2023

Conversation

halibobo1205
Copy link
Contributor

close #5420

super.destroy();
super.doClose();
logger.info("******** close end ********");
FullNode.shutDownSign = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the shutDownSign be assigned once the validate executor be closed? Is this reasonable to be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can find something in here, #4020.

if (channelFull != null) {
channelFull.shutdown().awaitTermination(5, TimeUnit.SECONDS);
}
if (channelSolidity != null) {
channelSolidity.shutdown().awaitTermination(5, TimeUnit.SECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the channelSolidity have not been shut down after 5 seconds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Waits for the channel to become terminated, giving up if the timeout is reached.

@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.7.3 milestone Aug 18, 2023
@@ -23,19 +22,13 @@ public TronApplicationContext(String... basePackages) {
}

@Override
public void destroy() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't all the places where the destroy method is called be replaced, including all test code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

destroy ->close -> doClose
image

@halibobo1205 halibobo1205 merged commit e1d096b into tronprotocol:develop Aug 23, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@PreDestroy does not work
4 participants