Skip to content

fix(stages): retain RocksDB TempDir in TestStageDB to prevent premature deletion#21444

Merged
joshieDo merged 1 commit intoparadigmxyz:mainfrom
ethfanWilliam:RocksDB
Jan 26, 2026
Merged

fix(stages): retain RocksDB TempDir in TestStageDB to prevent premature deletion#21444
joshieDo merged 1 commit intoparadigmxyz:mainfrom
ethfanWilliam:RocksDB

Conversation

@ethfanWilliam
Copy link
Contributor

The RocksDB temp directory was being dropped immediately after creation in both TestStageDB::default() and TestStageDB::new(), while the path was still being used by RocksDBProvider. This could cause the directory to be deleted before RocksDB finished using it, leading to undefined behavior.
Added temp_rocksdb_dir field to TestStageDB to keep the TempDir alive for the struct's lifetime, matching how we already handle temp_static_files_dir. Also matches the pattern used in provider/src/test_utils/mod.rs and exex/test-utils/src/lib.rs.

Copy link
Collaborator

@joshieDo joshieDo left a comment

Choose a reason for hiding this comment

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

i think RocksDB was creating it anyway, but it makes sense, ty

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Jan 26, 2026
@joshieDo joshieDo enabled auto-merge January 26, 2026 19:40
@joshieDo joshieDo added this pull request to the merge queue Jan 26, 2026
Merged via the queue into paradigmxyz:main with commit f1459fc Jan 26, 2026
46 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Jan 26, 2026
rakita pushed a commit that referenced this pull request Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants