Skip to content

feat(db):tune the databases closure#5429

Merged
halibobo1205 merged 4 commits intotronprotocol:developfrom
halibobo1205:feat/opt_database_close
Aug 23, 2023
Merged

feat(db):tune the databases closure#5429
halibobo1205 merged 4 commits intotronprotocol:developfrom
halibobo1205:feat/opt_database_close

Conversation

@halibobo1205
Copy link
Copy Markdown
Collaborator

close #5428 .

getChainBaseManager().shutdown();
dynamicArgs.close();
logger.info("******** end to shutdown ********");
FullNode.shutDownSign = true;
Copy link
Copy Markdown
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
Copy Markdown
Collaborator 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 .

public void shutdown() {
logger.info("******** Begin to pop revokingDb. ********");
logger.info("******** Before revokingDb size: {}.", size);
checkTmpStore.close();
Copy link
Copy Markdown
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
Copy Markdown
Collaborator 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
Copy Markdown

codecov-commenter commented Aug 18, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.02%. Comparing base (f20e11b) to head (d89c30b).
⚠️ Report is 585 commits behind head on develop.

Files with missing lines Patch % Lines
...n/java/org/tron/core/db/TronStoreWithRevoking.java 60.00% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #5429      +/-   ##
=============================================
- Coverage      61.09%   61.02%   -0.07%     
+ Complexity      9280     9279       -1     
=============================================
  Files            840      840              
  Lines          50175    50136      -39     
  Branches        5584     5583       -1     
=============================================
- Hits           30652    30595      -57     
- Misses         17125    17138      +13     
- Partials        2398     2403       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@halibobo1205 halibobo1205 force-pushed the feat/opt_database_close branch from b901f71 to c4d630e Compare August 21, 2023 10:58
@halibobo1205
Copy link
Copy Markdown
Collaborator Author

#5438

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

Tune the databases closure

4 participants