Skip to content

fix(fileservice): avoid draining COS responses on close - #30519

Merged
mergify[bot] merged 2 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/18a5b94ba5977ea4012aad5ee6ee30ca8ad13408af46141dc7b2f275ef725d0c
Oct 18, 2026
Merged

mergify[bot] merged 2 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/18a5b94ba5977ea4012aad5ee6ee30ca8ad13408af46141dc7b2f275ef725d0c

Conversation

@iamlinjunhong

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:

What this PR does / why we need it:

Parallel COS LOAD probes stop after finding a record boundary, but closing their GET response downloaded and discarded the remaining object suffix. Forward Close directly to the COS response body so cleanup releases the response without initiating that extra read. Existing reader Close points, CSV boundary selection, long-record handling, ranges, retry offsets and conditional identity checks remain intact.

Validation on macOS arm64 / Go 1.27.1:

  • Real COS client response-count tests cover unread/partial unbounded and bounded responses, full/empty reads, conditional identities, close errors, read errors/cancellation, and successful/failed retry reopening. Close adds no response Read or bytes.
  • Actual ReadFileOffset -> S3FS -> COS tests check exact ranges and every field of 12,288 unique records across strict/non-strict modes and LF/|| terminators, with unread tails at every probe.
  • A real HTTP server withholds a large response tail: Close completes and the server observes release while the client deadline remains live. The final test passes normal mode, race mode, and 100 focused race repetitions.
  • All five new regression functions fail at runtime against the original COS production implementation. Full fileservice and external package tests with -count=1 -vet=all, selected planner prescan controls, final HTTP focused vet/tests, formatting and incremental golangci-lint pass (0 issues).

The transport manages connection reuse; abandoning a large partial HTTP/1 response can require a new connection. This change covers COS only. It does not claim a new TKE/nightly throughput measurement or recovery of TPCC transaction throughput. CI results are pending publication. Reporter verification is expected after merge; the issue remains open for that verification.

@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 →

@XuPeng-SH

XuPeng-SH commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · done

Commit: 3d0af4a01b219c2c293de057c261e70fdbcb9906

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-xupeng · review

Commit: 3d0af4a01b219c2c293de057c261e70fdbcb9906

Assessment: approve

The complete delta and caller/transport review found no actionable defects. Removing the COS drain preserves response ownership, ranges, retry offsets and conditional identity handling.

Model: gpt-6-astra / xhigh

Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0

Validation:

  • All five added regressions passed in normal and race modes with -vet=all.

  • The real HTTP response-release test passed 100 focused race repetitions.

  • Normal package coverage reconciled 466 tests and three fuzz suites: 463 passed, six skipped.

  • Source remained unchanged. Commands, source fingerprints, exit receipts and log hashes are reconciled in /home/xupeng/.local/state/mo-bot/jobs/fd329b7993c64483a1cd3573/attempt-1/validation-audit.json.

  • The frozen exact-head evidence also reports successful Ubuntu UT, SCA and BVT checks.

Limitations:

  • The initial package run timed out after 240 seconds; targeted completion passed the unfinished tests. This was not one uninterrupted package pass. Local race validation covered the changed paths.

  • No live COS/TKE throughput measurement or complete resolution of #30511 is claimed. The linked issue body and raw CI/author logs were absent from the supplied evidence.

@mergify mergify Bot added the queued label Oct 18, 2026
@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-18 09:16 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-18 11:33 UTC · at 799523418e9f941afd65cd440d24e7fa0003a35e · squash

This pull request spent 2 hours 17 minutes 17 seconds in the queue, including 53 minutes 24 seconds running CI.

Required conditions to merge

XuPeng-SH added a commit that referenced this pull request Oct 18, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to #30511; follow-up to #30519. Keep the original issue open for
reporter performance acceptance.

## What this PR does / why we need it:

After #30519 added a fileservice regression test importing the SQL
external package, the Iceberg adapter module's transitive test
dependency closure expanded. Its checked-in `go.sum` was incomplete,
causing unrelated PRs to fail `go mod tidy -diff`. The Iceberg
workflow's path allowlist omitted fileservice changes, so the
introducing PR did not run that check.

Regenerate the nested `go.sum` with Go 1.27.1 and remove the incomplete
workflow path allowlist. The existing module-sync check now runs for
every configured pull-request event, following Go's actual dependency
graph instead of maintaining a second approximation. Dependency
requirements, versions, replacements and Go source/tests are unchanged.

Validation on Linux/amd64, Go 1.27.1:

- Reproduced the checksum drift on main `799523418e`; its parent
`adbdd5c718` passes. Excluding only the newly added fileservice LOAD
test also restores the check.
- After the fix, `GOWORK=off go mod tidy -diff` passes with no output,
and `go list -mod=readonly -deps ./...` loads 1,049 packages including
the adapter.
- Workflow semantic comparison confirms that removing the path filter is
the only configuration behavior change. actionlint 1.7.12 passes after
excluding its warning about the pre-existing disabled E2E `if: false`;
the unmodified base reports the same warning. `git diff --check` passes.
- UT race and BVT are inapplicable: this changes generated checksum
metadata and CI admission only. It does not modify executable Go code or
test cases. Remote CI is pending.

Previously excluded PRs gain one cache-backed module-only check with the
existing 15-minute timeout. It does not build the server, and the E2E
job remains disabled. There is no runtime or persistent-data change.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
ci — 02b81d8c Deployed Oct 18, 2026 by mergify[bot]
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/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants