Skip to content

fix(fileservice): avoid closing idle upload connections (#25458)#25463

Merged
mergify[bot] merged 1 commit into
matrixorigin:4.1-devfrom
LeftHandCold:25350-fileservice-idle-retry
Jul 6, 2026
Merged

fix(fileservice): avoid closing idle upload connections (#25458)#25463
mergify[bot] merged 1 commit into
matrixorigin:4.1-devfrom
LeftHandCold:25350-fileservice-idle-retry

Conversation

@LeftHandCold

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #25350
Related to #23225
Related to #24916

What this PR does / why we need it:

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

…#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
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added the queued label Jul 6, 2026
@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-06 09:23 UTC · Rule: release-4.1 · triggered by rule Automatic queue on approval for release-4.1
  • Checks skipped · PR is already up-to-date
  • Merged2026-07-06 09:23 UTC · at f0f72767d2ad1468dbc8a0d761362fbe0fc1d6db · squash

This pull request spent 11 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • github-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-neutral = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-neutral = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)

@mergify mergify Bot merged commit d20a343 into matrixorigin:4.1-dev Jul 6, 2026
23 of 24 checks passed
@mergify mergify Bot removed the queued label Jul 6, 2026
@LeftHandCold LeftHandCold deleted the 25350-fileservice-idle-retry branch July 6, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants