-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(db/trans-cache):avoid dumping a wrong cached data #5491
fix(db/trans-cache):avoid dumping a wrong cached data #5491
Conversation
@@ -318,6 +318,7 @@ private boolean handleException(Throwable e) { | |||
private void dump() { | |||
if (!isValid.get()) { | |||
logger.info("bloomFilters is not valid."); | |||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may cause the dump()
to have a probability of being skipped.
What about waiting for the isValid
to be true for a certain time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not very friendly, potentially a long time, like node just starting up as before, cost 15+ s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I see, isValid
is used for sync dump()
with flush()
, isAlive
is used for recovery()
.
isValid
changes from false
to true
may not take a long time, just waiting for 1 or 2 seconds is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's really no need to think about flush()
for kill -15
, flush()
will always take precedence in here https://github.com/tronprotocol/java-tron/blob/release_v4.7.3/framework/src/main/java/org/tron/common/application/ApplicationImpl.java#L73
No description provided.