Conversation
cb1kenobi
commented
Mar 17, 2026
| this->columns.clear(); | ||
|
|
||
| { | ||
| std::lock_guard<std::mutex> lock(this->listenerCallbacksMutex); |
Contributor
Author
There was a problem hiding this comment.
This is a defensive measure. Claude recommended it. I don't think it does anything, but better safe than sorry.
cb1kenobi
commented
Mar 17, 2026
| DEBUG_LOG("%p DBRegistry::CloseDB Purging descriptor for \"%s\"\n", instance.get(), path.c_str()); | ||
| entry->descriptor->close(); | ||
| // since the registry itself always has a ref, we need to check for ref count 1 | ||
| if (entry && entry->descriptor && entry->descriptor.use_count() <= 1) { |
Contributor
Author
There was a problem hiding this comment.
This is what caused the actual segfault.
cb1kenobi
commented
Mar 17, 2026
| entry->descriptor->close(); | ||
|
|
||
| // re-acquire the mutex to check and potentially remove the descriptor | ||
| { |
Contributor
Author
There was a problem hiding this comment.
If we're gonna do a block scope for a mutex, might as well put it around the mutex instead of the entire if-block.
Contributor
📊 Benchmark Resultsget-sync.bench.tsgetSync() > random keys - small key size (100 records)
getSync() > sequential keys - small key size (100 records)
ranges.bench.tsgetRange() > small range (100 records, 50 range)
realistic-load.bench.tsRealistic write load with workers > write variable records with transaction log
transaction-log.bench.tsTransaction log > read 100 iterators while write log with 100 byte records
Transaction log > read one entry from random position from log with 1000 100 byte records
worker-put-sync.bench.tsputSync() > random keys - small key size (100 records, 10 workers)
worker-transaction-log.bench.tsTransaction log with workers > write log with 100 byte records
Results from commit e7b3ecc |
kriszyp
approved these changes
Mar 18, 2026
Member
kriszyp
left a comment
There was a problem hiding this comment.
Looks good, thank you for tracking this down!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rocksdb-jswas causing Harper to crash while running tests. There must have been some async cleanup where aDBRegisitryEntrywas being closed by two or more triggers (e.g. db close w/ ref count = 1 or shutdown). The registry entries are plain old pointers, so we need to check them before we use them.