Skip to content

test(db): fix org.iq80.leveldb.DBException: Closed - #5528

Merged
halibobo1205 merged 1 commit into
tronprotocol:release_v4.7.3from
halibobo1205:test/test_opt
Oct 11, 2023
Merged

halibobo1205 merged 1 commit into
tronprotocol:release_v4.7.3from
halibobo1205:test/test_opt

Conversation

@halibobo1205

Copy link
Copy Markdown
Collaborator

Error Log

16:54:20.835 INFO [DB] ******** Begin to close SectionBloomStore. ********
16:54:20.836 INFO [DB] ******** End to close SectionBloomStore. ********
16:54:20.836 INFO [DB] ******** Begin to close TreeBlockIndexStore. ********
16:54:20.836 INFO [DB] ******** End to close TreeBlockIndexStore. ********
16:54:20.836 INFO [DB] ******** Begin to close PbftSignDataStore. ********
16:54:20.836 INFO [DB] ******** End to close PbftSignDataStore. ********
16:54:20.836 INFO [DB] ******** Begin to close CommonDataBase. ********
16:54:20.836 INFO [DB] ******** End to close CommonDataBase. ********
16:54:20.836 INFO [DB] ******** Begin to close TransactionHistoryStore. ********
16:54:20.837 INFO [DB] ******** End to close TransactionHistoryStore. ********
16:54:20.837 INFO [DB] ******** Begin to close RecentBlockStore. ********
16:54:20.838 INFO [DB] ******** End to close RecentBlockStore. ********
16:54:20.838 INFO [DB] ******** Begin to close TransactionRetStore. ********
16:54:20.838 INFO [DB] ******** End to close TransactionRetStore. ********
16:54:20.838 INFO [DB] ******** Begin to close TransactionStore. ********
16:54:20.838 INFO [DB] ******** End to close TransactionStore. ********
16:54:20.838 INFO [DB] ******** Begin to close CommonStore. ********
16:54:20.838 INFO [DB] ******** End to close CommonStore. ********
16:54:20.838 INFO [DB] ******** Begin to close IncrementalMerkleTreeStore. ********
16:54:20.838 INFO [DB] ******** End to close IncrementalMerkleTreeStore. ********
16:54:20.839 INFO [DB] ******** Begin to close ZKProofStore. ********
16:54:20.840 INFO [DB] ******** End to close ZKProofStore. ********
16:54:20.840 INFO [DB] ******** Begin to close NullifierStore. ********
16:54:20.840 INFO [DB] ******** End to close NullifierStore. ********
16:54:20.840 INFO [DB] ******** Begin to close StorageRowStore. ********
16:54:20.840 INFO [DB] ******** End to close StorageRowStore. ********
16:54:20.841 INFO [DB] ******** Begin to close DelegatedResourceAccountIndexStore. ********
16:54:20.842 INFO [DB] ******** End to close DelegatedResourceAccountIndexStore. ********
16:54:20.842 INFO [DB] ******** Begin to close DelegatedResourceStore. ********
16:54:20.842 INFO [DB] ******** End to close DelegatedResourceStore. ********
16:54:20.842 INFO [DB] ******** Begin to close ContractStateStore. ********
16:54:20.842 INFO [DB] ******** End to close ContractStateStore. ********
16:54:20.842 INFO [DB] ******** Begin to close ContractStore. ********
16:54:20.844 INFO [DB] ******** End to close ContractStore. ********
16:54:20.844 INFO [DB] ******** Begin to close CodeStore. ********
16:54:20.844 INFO [DB] ******** End to close CodeStore. ********
16:54:20.844 INFO [DB] ******** Begin to close AbiStore. ********
16:54:20.844 INFO [DB] ******** End to close AbiStore. ********
16:54:20.844 INFO [DB] ******** Begin to close MarketPairToPriceStore. ********
16:54:20.845 INFO [DB] ******** End to close MarketPairToPriceStore. ********
16:54:20.845 INFO [DB] ******** Begin to close MarketPairPriceToOrderStore. ********
16:54:20.846 INFO [DB] ******** End to close MarketPairPriceToOrderStore. ********
16:54:20.846 INFO [DB] ******** Begin to close MarketOrderStore. ********
16:54:20.846 INFO [DB] ******** End to close MarketOrderStore. ********
16:54:20.846 INFO [DB] ******** Begin to close MarketAccountStore. ********
16:54:20.846 INFO [DB] ******** End to close MarketAccountStore. ********
16:54:20.846 INFO [DB] ******** Begin to close ExchangeV2Store. ********
16:54:20.846 INFO [DB] ******** End to close ExchangeV2Store. ********
16:54:20.846 INFO [DB] ******** Begin to close ExchangeStore. ********
16:54:20.846 INFO [DB] ******** End to close ExchangeStore. ********
16:54:20.846 INFO [DB] ******** Begin to close ProposalStore. ********
16:54:20.846 INFO [DB] ******** End to close ProposalStore. ********
16:54:20.846 INFO [DB] ******** Begin to close AccountIndexStore. ********
16:54:20.846 INFO [DB] ******** End to close AccountIndexStore. ********
16:54:20.847 INFO [DB] ******** Begin to close AccountIdIndexStore. ********
16:54:20.847 INFO [DB] ******** End to close AccountIdIndexStore. ********
16:54:20.847 INFO [DB] ******** Begin to close BlockIndexStore. ********
16:54:20.847 INFO [DB] ******** End to close BlockIndexStore. ********
16:54:20.847 INFO [DB] ******** Begin to close AssetIssueV2Store. ********
16:54:20.847 INFO [DB] ******** End to close AssetIssueV2Store. ********
16:54:20.847 INFO [DB] ******** Begin to close AssetIssueStore. ********
16:54:20.847 INFO [DB] ******** End to close AssetIssueStore. ********
16:54:20.847 INFO [DB] ******** Begin to close BlockStore. ********
16:54:20.847 INFO [DB] ******** End to close BlockStore. ********
16:54:20.847 INFO [DB] ******** Begin to close AccountAssetStore. ********
16:54:20.847 INFO [DB] ******** End to close AccountAssetStore. ********
16:54:20.848 INFO [DB] ******** Begin to close VotesStore. ********
16:54:20.848 INFO [DB] ******** End to close VotesStore. ********
16:54:20.848 INFO [DB] ******** Begin to close WitnessScheduleStore. ********
16:54:20.849 INFO [DB] ******** End to close WitnessScheduleStore. ********
16:54:20.849 INFO [DB] ******** Begin to close WitnessStore. ********
16:54:20.850 INFO [DB] ******** End to close WitnessStore. ********
16:54:20.850 INFO [DB] ******** Begin to close AccountStore. ********
16:54:20.854 INFO [DB] ******** End to close AccountStore. ********
16:54:20.860 INFO [DB] ******** Begin to close AccountTraceStore. ********
16:54:20.861 INFO [DB] ******** End to close AccountTraceStore. ********
16:54:20.862 INFO [DB] ******** Begin to close BalanceTraceStore. ********
16:54:20.862 INFO [DB] ******** End to close BalanceTraceStore. ********
16:54:20.862 INFO [DB] ******** Begin to close DelegationStore. ********
16:54:20.862 INFO [DB] ******** End to close DelegationStore. ********
16:54:20.862 INFO [DB] ******** Begin to close AccountStateStoreTrie. ********
16:54:20.862 INFO [DB] ******** End to close AccountStateStoreTrie. ********
16:54:20.862 INFO [DB] ******** Begin to close KhaosDatabase. ********
16:54:20.862 INFO [DB] ******** End to close KhaosDatabase. ********
16:54:20.862 INFO [DB] ******** Begin to close TransactionCache. ********
16:54:20.862 INFO [DB] dump bloomFilters start.
16:54:20.865 INFO [DB] dump bloomFilters[0] to file.
16:54:20.865 INFO [DB] dump bloomFilters[1] to file.
16:54:21.029 ERROR [consensus] Produce block error.
org.iq80.leveldb.DBException: Closed
	at org.fusesource.leveldbjni.internal.JniDB.get(JniDB.java:75)
	at org.tron.common.storage.leveldb.LevelDbDataSourceImpl.getData(LevelDbDataSourceImpl.java:201)
	at org.tron.core.db2.common.LevelDB.get(LevelDB.java:25)
	at org.tron.core.db2.common.LevelDB.get(LevelDB.java:12)
	at org.tron.core.db2.core.SnapshotRoot.get(SnapshotRoot.java:55)
	at org.tron.core.db2.core.Chainbase.getUnchecked(Chainbase.java:153)
	at org.tron.core.db.TronStoreWithRevoking.getUnchecked(TronStoreWithRevoking.java:125)
	at org.tron.core.store.WitnessScheduleStore.getData(WitnessScheduleStore.java:43)
	at org.tron.core.store.WitnessScheduleStore.getActiveWitnesses(WitnessScheduleStore.java:64)
	at org.tron.consensus.ConsensusDelegate.getActiveWitnesses(ConsensusDelegate.java:88)
	at org.tron.consensus.dpos.DposSlot.getScheduledWitness(DposSlot.java:57)
	at org.tron.consensus.dpos.DposTask.produceBlock(DposTask.java:99)
	at org.tron.consensus.dpos.DposTask.lambda$init$0(DposTask.java:61)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

How To Fix

@ContextConfiguration in spring-test, instead of using the TronApplicationContext, a testContxt is generated, which would cause the database to close first.

     @AfterClass
     public static void destroy() {
       appT1.shutdown(); // shutdown service first.
       Args.clearParam();
    }

@halibobo1205
halibobo1205 merged commit 94e1a84 into tronprotocol:release_v4.7.3 Oct 11, 2023
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.7.3 milestone Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants