ethereumjs / ethereumjs-monorepo

Monorepo for the Ethereum VM TypeScript Implementation
2.6k stars 757 forks source link

client: StorageFetcher Doesn't Terminate Gracefully #3220

Closed scorbajio closed 1 month ago

scorbajio commented 10 months ago

Currently, during snap sync, if the client is terminated using ctr-c, the StorageFetcher attempts to use the database when it's not open:

2024-01-09T01:10:24.786Z client:StorageFetcher Entering nextTasks with primary queue length of 0 and secondary queue length of 0
2024-01-09T01:10:24.786Z client:StorageFetcher Storage requests in primary queue:
2024-01-09T01:10:24.786Z client:StorageFetcher Storage requests in secondary queue:
2024-01-09T01:10:24.786Z client:StorageFetcher No idle peer available, skip next job execution.
[01-08|18:10:24] INFO Caught interrupt signal. Obtaining client handle for clean shutdown...
[01-08|18:10:24] INFO (This might take a little longer if client not yet fully started)
[01-08|18:10:24] INFO Shutting down the client and the servers...
[01-08|18:10:24] INFO Stopped execution.
2024-01-09T01:10:24.847Z client:StorageFetcher Error: Database is not open
    at maybeError (/home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/node_modules/abstract-level/abstract-level.js:806:27)
    at ClassicLevel.get (/home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/node_modules/abstract-level/abstract-level.js:282:9)
    at LevelDB.get (/home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/packages/client/dist/src/execution/level.js:55:41)
    at CheckpointDB.get (/home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/packages/trie/dist/cjs/db/checkpoint.js:127:37)
    at Trie.lookupNode (/home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/packages/trie/dist/cjs/trie.js:420:39)
    at /home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/packages/trie/dist/cjs/util/walkController.js:41:40
    at new Promise (<anonymous>)
    at WalkController.startWalk (/home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/packages/trie/dist/cjs/util/walkController.js:36:16)
    at WalkController.newWalk (/home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/packages/trie/dist/cjs/util/walkController.js:32:24)
    at Trie.walkTrie (/home/indigoomega021/code/projects/eth/ethjs-lodestar/ethereumjs-monorepo/packages/trie/dist/cjs/trie.js:372:50)
[01-08|18:10:24] WARN Error storing received block or header result: Error: Database is not open
2024-01-09T01:10:24.854Z client:StorageFetcher Cleared out fetcher total=3 processed=1 finished=0
[01-08|18:10:24] WARN Error storing received block or header result: Error: Database is not open
[01-08|18:10:24] INFO Stopped eth service.
[01-08|18:10:24] INFO Stopped rlpx server.
[01-08|18:10:24] INFO Exiting.

To recreate the issue, run the ethjs snap sync devnet. For help, see this PR.

holgerd77 commented 1 month ago

Still an issue?

scorbajio commented 1 month ago

This issue has not come up since and may have been addressed. Closing for now.