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(db):tune the databases closure #5429

Merged

Conversation

halibobo1205
Copy link
Contributor

close #5428 .

}
dbManager.stopRePushThread();
dbManager.stopRePushTriggerThread();
EventPluginLoader.getInstance().stopPlugin();
dbManager.stopFilterProcessThread();
dbManager.stopValidateSignThread();
getChainBaseManager().shutdown();
dynamicArgs.close();
logger.info("******** end to shutdown ********");
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 this shutDownSign assign move to dbmanager.stopValidateSignThread?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will be solved here #5433 .

@@ -284,10 +284,6 @@ public synchronized void disable() {

@Override
public void shutdown() {
logger.info("******** Begin to pop revokingDb. ********");
logger.info("******** Before revokingDb size: {}.", size);
checkTmpStore.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should remove the logs and the operation closing checkTmpStore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to DisposableBeanAdapter.inferDestroyMethodIfNecessary:

If the current value of the given beanDefinition's "destroyMethodName" property is AbstractBeanDefinition.INFER_METHOD, then attempt to infer a destroy method. Candidate methods are currently limited to public, no-arg methods named "close" or "shutdown" (whether declared locally or inherited). The given BeanDefinition's "destroyMethodName" is updated to be null if no such method is found, otherwise set to the name of the inferred method. This constant serves as the default for the @bean#destroyMethod attribute and the value of the constant may also be used in XML within the or attributes.
Also processes the java.io.Closeable and AutoCloseable interfaces, reflectively calling the "close" method on implementing beans as well.

checkTmpStore implements AutoCloseable, will be auto-closed.

@halibobo1205 halibobo1205 self-assigned this Aug 17, 2023
@halibobo1205 halibobo1205 force-pushed the feat/opt_database_close branch 2 times, most recently from 2a43a17 to b901f71 Compare August 18, 2023 02:23
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.7.3 milestone Aug 18, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #5429 (b901f71) into develop (a9c4f43) will increase coverage by 0.03%.
Report is 1 commits behind head on develop.
The diff coverage is 87.50%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@              Coverage Diff              @@
##             develop    #5429      +/-   ##
=============================================
+ Coverage      60.94%   60.98%   +0.03%     
- Complexity      9243     9255      +12     
=============================================
  Files            840      840              
  Lines          50057    50012      -45     
  Branches        5577     5576       -1     
=============================================
- Hits           30508    30499       -9     
+ Misses         17152    17112      -40     
- Partials        2397     2401       +4     
Files Changed Coverage Δ
...n/java/org/tron/core/db2/core/SnapshotManager.java 73.72% <ø> (-0.30%) ⬇️
...n/java/org/tron/core/db/TronStoreWithRevoking.java 83.13% <60.00%> (-1.68%) ⬇️
.../src/main/java/org/tron/core/ChainBaseManager.java 90.00% <100.00%> (-2.46%) ⬇️
...e/src/main/java/org/tron/core/db/TronDatabase.java 97.77% <100.00%> (+14.85%) ⬆️
...a/org/tron/common/application/ApplicationImpl.java 90.47% <100.00%> (+2.10%) ⬆️
...mework/src/main/java/org/tron/core/db/Manager.java 56.92% <100.00%> (+0.15%) ⬆️

... and 8 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@halibobo1205
Copy link
Contributor Author

#5438

@halibobo1205 halibobo1205 merged commit a4100b6 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.

Tune the databases closure
4 participants