Repository navigation
fix(rest): make RestCatalog safe to share across threads - #1092
Open
smaheshwar-pltr wants to merge 5 commits into
Open
smaheshwar-pltr wants to merge 5 commits into
smaheshwar-pltr wants to merge 5 commits into
Conversation
HttpClient sent every request through one cpr::ConnectionPool, and libcurl does not support sharing a connection cache between threads. Overlapping requests, for example from token refresh or the metrics executor, could crash. Give each in-flight request its own pool and reuse idle pools. HttpResponse now copies the status, body and headers out of cpr::Response, whose curl handle must be freed before its pool is reused. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
commented
Nov 4, 2026
| #include "iceberg/catalog/rest/http_client.h" | ||
|
|
||
| #include <map> | ||
| #include <mutex> |
Contributor
Author
smaheshwar-pltr
marked this pull request as ready for review
November 4, 2026 23:57
Head() lost its RequestUri() call in a rebase, so relative paths were sent without the base URI. Restore it, and check that every request method resolves relative paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make() accepts a custom HTTP client factory, and every catalog call goes through that client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 #1091.
Note: contains changes from #1090 which is a pre-requisite for this. See 7f9a593 for the only actual commit.