fix(rest): make RestCatalog safe to share across threads - #22
Open
smaheshwar-pltr wants to merge 1 commit into
Open
smaheshwar-pltr wants to merge 1 commit into
smaheshwar-pltr wants to merge 1 commit into
Conversation
smaheshwar-pltr
force-pushed
the
fix/rest-http-client-thread-safety
branch
from
September 25, 2026 21:44
79e980e to
14c719e
Compare
smaheshwar-pltr
force-pushed
the
rest-catalog-thread-safety
branch
from
September 25, 2026 21:44
01a8847 to
698aa5d
Compare
smaheshwar-pltr
force-pushed
the
rest-catalog-thread-safety
branch
from
September 25, 2026 22:22
698aa5d to
731ea55
Compare
AsCatalog() read and wrote the cached default catalog without a lock, so concurrent calls raced. It was the only state RestCatalog changed after Make(). Guard it with a mutex and document RestCatalog as thread-safe. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
smaheshwar-pltr
force-pushed
the
fix/rest-http-client-thread-safety
branch
from
September 25, 2026 23:14
14c719e to
dee5b68
Compare
smaheshwar-pltr
force-pushed
the
rest-catalog-thread-safety
branch
from
September 25, 2026 23:14
731ea55 to
b79dc0f
Compare
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.
Closes #21. Depends on #19.
AsCatalog()read and wrote the cached default catalog without a lock. That was the only stateRestCatalogchanged afterMake(), so this guards it with a mutex and documentsRestCatalogas thread-safe.The new test shares one catalog between 16 threads. Under ASan it failed 6 of 8 runs without the mutex (use-after-free or failed calls) and passed 8 of 8 with it. CI doesn't run the REST integration tests under ASan.
🤖 Generated with Claude Code