Repository navigation
fix(fileservice): avoid closing idle upload connections - #25458
mergify[bot] merged 2 commits into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed from first principles and unhappy-path angles.\n\nI checked the functional closure around the COS idle upload failure: the periodic CloseIdleConnections call was the active source of mid-upload idle-connection churn, while Go's Transport still bounds and expires idle connections through IdleConnTimeout / MaxIdleConns / MaxIdleConnsPerHost / MaxConnsPerHost after this change. The retryable classification for "server closed idle connection" is also acceptable in this fileservice path because QCloud write retries replay data through memory / seek / multipart buffers, and the read-side retry paths recreate range readers.\n\nUnhappy-path review covered leak/hung/OOM risk, stale metric cleanup, custom vs global transports, upload retry safety, and active connection metric behavior. I did not find a blocking issue.\n\nLocal verification:\n- git diff --check origin/main...HEAD\n- go build ./pkg/fileservice\n- go vet ./pkg/fileservice\n- go test -v -count=1 ./pkg/fileservice\n\nCI is green as well.
Merge Queue Status
This pull request spent 1 hour 16 minutes 2 seconds in the queue, including 1 hour 15 minutes 51 seconds running CI. Required conditions to merge
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
LGTM.
The main behavior change looks right to me: this stops force-closing idle fileservice HTTP connections every 5s and lets the transport's own idle policy manage them, which is exactly the safer direction for long-running or intermittent COS uploads. Treating http: server closed idle connection as retryable also matches the transient transport failure mode we want to mask.
Non-blocking follow-up: it would still be nice to add a multipart UploadPart retry / retry-exhaust regression case in pkg/fileservice/parallel_sdk_test.go, but I don't see a substantive blocker in the patch itself.
…#25458) `LOAD DATA` from COS can intermittently fail with `http: server closed idle connection` during long multipart uploads. The fileservice HTTP transport already has `IdleConnTimeout` and connection limits, but the background metrics cleanup loop was also calling `CloseIdleConnections()` every 5s, which can close an idle upload connection between multipart requests. Changes: - stop periodically calling `httpTransport.CloseIdleConnections()` from the fileservice background loop - keep stale connection metric cleanup, using `IdleConnTimeout + 2s` as the stale metric threshold - treat `server closed idle connection` as retryable so existing COS retry wrappers can retry this transient transport error - add retryability coverage for the COS error string Validation: ```text go build ./pkg/fileservice go vet ./pkg/fileservice go test -v -count=1 ./pkg/fileservice PASS ok github.com/matrixorigin/matrixone/pkg/fileservice 27.250s ``` Approved by: @XuPeng-SH
) `LOAD DATA` from COS can intermittently fail with `http: server closed idle connection` during long multipart uploads. The fileservice HTTP transport already has `IdleConnTimeout` and connection limits, but the background metrics cleanup loop was also calling `CloseIdleConnections()` every 5s, which can close an idle upload connection between multipart requests. Changes: - stop periodically calling `httpTransport.CloseIdleConnections()` from the fileservice background loop - keep stale connection metric cleanup, using `IdleConnTimeout + 2s` as the stale metric threshold - treat `server closed idle connection` as retryable so existing COS retry wrappers can retry this transient transport error - add retryability coverage for the COS error string Approved by: @XuPeng-SH
…#25458) `LOAD DATA` from COS can intermittently fail with `http: server closed idle connection` during long multipart uploads. The fileservice HTTP transport already has `IdleConnTimeout` and connection limits, but the background metrics cleanup loop was also calling `CloseIdleConnections()` every 5s, which can close an idle upload connection between multipart requests. Changes: - stop periodically calling `httpTransport.CloseIdleConnections()` from the fileservice background loop - keep stale connection metric cleanup, using `IdleConnTimeout + 2s` as the stale metric threshold - treat `server closed idle connection` as retryable so existing COS retry wrappers can retry this transient transport error - add retryability coverage for the COS error string Validation: ```text go build ./pkg/fileservice go vet ./pkg/fileservice go test -v -count=1 ./pkg/fileservice PASS ok github.com/matrixorigin/matrixone/pkg/fileservice 27.250s ``` Approved by: @XuPeng-SH
…#25458) `LOAD DATA` from COS can intermittently fail with `http: server closed idle connection` during long multipart uploads. The fileservice HTTP transport already has `IdleConnTimeout` and connection limits, but the background metrics cleanup loop was also calling `CloseIdleConnections()` every 5s, which can close an idle upload connection between multipart requests. Changes: - stop periodically calling `httpTransport.CloseIdleConnections()` from the fileservice background loop - keep stale connection metric cleanup, using `IdleConnTimeout + 2s` as the stale metric threshold - treat `server closed idle connection` as retryable so existing COS retry wrappers can retry this transient transport error - add retryability coverage for the COS error string Validation: ```text go build ./pkg/fileservice go vet ./pkg/fileservice go test -v -count=1 ./pkg/fileservice PASS ok github.com/matrixorigin/matrixone/pkg/fileservice 27.250s ``` Approved by: @XuPeng-SH
…#25458) `LOAD DATA` from COS can intermittently fail with `http: server closed idle connection` during long multipart uploads. The fileservice HTTP transport already has `IdleConnTimeout` and connection limits, but the background metrics cleanup loop was also calling `CloseIdleConnections()` every 5s, which can close an idle upload connection between multipart requests. Changes: - stop periodically calling `httpTransport.CloseIdleConnections()` from the fileservice background loop - keep stale connection metric cleanup, using `IdleConnTimeout + 2s` as the stale metric threshold - treat `server closed idle connection` as retryable so existing COS retry wrappers can retry this transient transport error - add retryability coverage for the COS error string Validation: ```text go build ./pkg/fileservice go vet ./pkg/fileservice go test -v -count=1 ./pkg/fileservice PASS ok github.com/matrixorigin/matrixone/pkg/fileservice 27.250s ``` Approved by: @XuPeng-SH
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #25350
Related to #23225
Related to #24916
What this PR does / why we need it:
LOAD DATAfrom COS can intermittently fail withhttp: server closed idle connectionduring long multipart uploads. The fileservice HTTP transport already hasIdleConnTimeoutand connection limits, but the background metrics cleanup loop was also callingCloseIdleConnections()every 5s, which can close an idle upload connection between multipart requests.Changes:
httpTransport.CloseIdleConnections()from the fileservice background loopIdleConnTimeout + 2sas the stale metric thresholdserver closed idle connectionas retryable so existing COS retry wrappers can retry this transient transport errorValidation: