Repository navigation
fix(s3): make the socket pool size configurable and apply it to http endpoints - #14
chenrui333 wants to merge 2 commits into
Conversation
…endpoints The S3 client's agent pool was hard-coded at 50 sockets, and the agent was passed only as `httpsAgent`. NodeHttpHandler picks the agent by endpoint scheme, so an http:// endpoint (MinIO, RustFS, an in-cluster gateway) silently fell back to the SDK's default agent and ignored the configured pool. Local tests and benchmarks against RustFS therefore never exercised the pool an https deployment uses. Add STORAGE_S3_MAX_SOCKETS (default 50, the previous value) and build both the http and the https agent from the same options. tests/s3-socket-pool.test.ts holds one GetObject body unread with a pool of one socket and checks that a second GetObject waits for it; against an http:// endpoint it did not wait before this change. Signed-off-by: Rui Chen <rui@chenrui.dev>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d95a8f9268
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 'STORAGE_DRIVER': type.unit('s3'), | ||
| 'STORAGE_S3_BUCKET': 'string', | ||
| 'STORAGE_S3_SOCKET_TIMEOUT_MS': 'number.integer >= 0 = 10000', | ||
| 'STORAGE_S3_MAX_SOCKETS': 'number.integer >= 1 = 50', |
There was a problem hiding this comment.
Preserve socket capacity for streaming merge writes
With STORAGE_S3_MAX_SOCKETS=1, the first download of an unmerged entry containing a sufficiently large Part can stall and fail. The lazy merge in Storage.download() reads Parts through streamParts() while feeding S3Adapter.uploadStream(): the Part's GET holds the only socket, while the multipart uploader needs another connection to initialize/upload the merged object. Once the uploader's buffers fill, backpressure prevents the GET from completing and releasing its socket, so progress stops until a timeout (or indefinitely when socket timeouts are disabled). Reject a pool size of one or separate read/write capacity, and cover a streaming merge rather than only independent GETs.
Useful? React with 👍 / 👎.
A streaming merge holds a part GetObject while its multipart upload waits for a socket from the same pool, so a pool of one stalls the first restore of any unmerged entry. Reject it, note in the README that a shared pool smaller than the number of concurrent merges can stall them, and exercise the bound with two held reads. Signed-off-by: Rui Chen <rui@chenrui.dev>
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Superseded by upstream v9.10.0 (falcondev-oss#296). |
The S3 client uses one hard-coded 50-socket keep-alive agent and passes it only as
httpsAgent, so http:// endpoints (MinIO, RustFS, in-cluster gateways) silently use the SDK default agent. AddsSTORAGE_S3_MAX_SOCKETS(default 50), applied to both agents.