Skip to content

feat(all):make @PreDestroy work#5421

Merged
halibobo1205 merged 2 commits intotronprotocol:developfrom
halibobo1205:fix/pre_destroy
Aug 23, 2023
Merged

feat(all):make @PreDestroy work#5421
halibobo1205 merged 2 commits intotronprotocol:developfrom
halibobo1205:fix/pre_destroy

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.

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
}

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement minor enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@PreDestroy does not work

4 participants