Skip to content

Conversation

@rainsupreme
Copy link
Contributor

This makes it safe to delete hashtable while a safe iterator is iterating it. This currently isn't possible, but this improvement is required for fork-less replication #1754 which @JimB123 is actively working on.

We discussed these issues in #2611 which guards against a different but related issue: calling hashtableNext again after it has already returned false.

I implemented a singly linked list that hashtable uses to track its current safe iterators. It is used to invalidate all associated safe iterators when the hashtable is released. A singly linked list is acceptable because the list length is always very small - typically zero and no more than a handful.

…able deleted from under safe iterator

Signed-off-by: Rain Valentine <rsg000@gmail.com>
@rainsupreme rainsupreme force-pushed the safe-iterator-tracking branch from d67a6b7 to 56db3fd Compare November 5, 2025 21:59
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 81.48148% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.42%. Comparing base (c88c94e) to head (014b26b).
⚠️ Report is 4 commits behind head on unstable.

Files with missing lines Patch % Lines
src/hashtable.c 81.48% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2807      +/-   ##
============================================
- Coverage     72.43%   72.42%   -0.01%     
============================================
  Files           128      128              
  Lines         70245    70297      +52     
============================================
+ Hits          50880    50915      +35     
- Misses        19365    19382      +17     
Files with missing lines Coverage Δ
src/hashtable.c 89.16% <81.48%> (-0.23%) ⬇️

... and 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Rain Valentine <rsg000@gmail.com>
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.

1 participant