feat(event): optimize event service thread close logic by zeusoo001 · Pull Request #6463 · tronprotocol/java-tron

Conversation

@zeusoo001

What does this PR do?
Optimize event service thread close logic.

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

Sunny6889

long endNum = manager.getDynamicPropertiesStore().getLatestSolidifiedBlockNum();
while (tmp < endNum) {
if (thread.isInterrupted()) {
if (thread.isInterrupted() || isClosed) {

Choose a reason for hiding this comment

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

It is a good resource leakage fix. I wonder how you find it?

Choose a reason for hiding this comment

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

It may throw exception when the program closes:

Image

Sunny6889

0xbigapple

Choose a reason for hiding this comment

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

good

lvs0075

kuny0707

halibobo1205 pushed a commit to halibobo1205/java-tron that referenced this pull request

Oct 22, 2025

halibobo1205 pushed a commit to halibobo1205/java-tron that referenced this pull request

Oct 22, 2025

warku123 pushed a commit to warku123/java-tron that referenced this pull request

Feb 6, 2026

Labels