Repository navigation
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.
Deep review of exact head 2b559ae3484a0c215dbb0f00a457fd4b4233d068.
[P1] The resolver is still process-wide for every default HTTP client. Removing net.DefaultResolver = dnsResolver fixes MORPC/goetty, but the same init() still assigns http.DefaultTransport = httpRoundTripper. That round tripper owns httpTransport, whose DialContext uses httpDialer and therefore the same caching dnsResolver. Consequently any unrelated http.DefaultClient, http.Get, or &http.Client{} still inherits the FileService DNS TTL. Concrete in-tree consumers include Iceberg REST/signed HTTP, Grafana, and mo-debug; the ESQL and sidecar code already contain explicit workarounds for this FileService global override.
This is broader than stale DNS: the FileService transport also installs its 20-second response-header timeout, connection caps, and TLSClientConfig{InsecureSkipVerify: true} process-wide. Thus the PR's stated ownership boundary (“FileService's own dialer keeps caching; future non-FileService dials use the standard resolver”) is not true for HTTP clients, and the analogous endpoint-move failure remains.
A counterexample ownership test that asserts http.DefaultTransport != httpRoundTripper fails deterministically on this head. Please remove the remaining http.DefaultTransport assignment as well and extend TestDNSResolverScope to cover both process globals. FileService backends retain their behavior: S3/Aliyun/MinIO/QCloud explicitly use newHTTPClient, and HDFS explicitly uses httpDialer.
Validation: full pkg/fileservice tests pass; focused -race -count=20 passes; vet passes. The counterexample fails only on the incomplete ownership boundary above.
|
@XuPeng-SH Addressed the requested ownership-boundary change in
Audited FileService consumers: AWS v2, Aliyun, MinIO, and QCloud explicitly use Validation passed:
Please re-review when convenient. |
There was a problem hiding this comment.
Deep re-review of exact head ae345ef.\n\nThe previous P1 is closed. AWS region discovery now uses an explicitly owned FileService client and request context. The 20-second deadline bounds dial, TLS, and response-header waits; cancellation reaches http.Transport; and every successful response closes its body. The process-wide net.DefaultResolver and http.DefaultTransport remain untouched, while FileService object-storage and HDFS paths retain the intended caching resolver.\n\nI traced the validate -> region probe -> client/transport chain and found no remaining correctness, lifecycle, compatibility, or material performance blocker. The new client allocation is construction-time only and shares the existing bounded transport.\n\nValidation:\n- affected package list/build/vet: pass\n- full pkg/fileservice: pass\n- focused region/DNS tests under race count 20: pass\n- related ESQL and sidecar HTTP lifecycle tests: pass\n- git diff check: pass
Merge Queue Status
This pull request spent 20 minutes 49 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #27548 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
Failing checks:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
…in#27548) ## 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: issue matrixorigin#27362 ## What this PR does / why we need it: FileService installs a caching DNS resolver for object storage and HDFS clients. Its package initializer also assigned that resolver to `net.DefaultResolver`, which unintentionally made the FileService cache process-wide. This affects unrelated clients such as MORPC/goetty. When a service keeps the same DNS name but moves to a new IP, a replacement MORPC backend performs a new dial but can still receive the old address from the FileService resolver until the DNS record TTL expires. In the Docker reproduction, the embedded DNS TTL was 600 seconds, so CN, TN, and Proxy continued dialing the unreachable LogService IP after the endpoint and system DNS had recovered. The MORPC backend replacement path itself remains valid and is not changed by this PR. This change only removes the process-wide resolver assignment. FileService's `httpDialer` continues to use the same caching resolver explicitly, so S3 SDKs, HDFS, and the FileService HTTP transport keep their existing DNS caching behavior. The regression test verifies both ownership boundaries: - FileService does not replace `net.DefaultResolver`. - FileService's own dialer still uses its caching resolver. There are no configuration, wire-format, retry-policy, or persistent-state changes. Normal active connections are unaffected; the behavioral difference is limited to future non-FileService dials, which now use Go's standard resolver and can observe endpoint IP changes. Tested with: `TestDNSResolverScope` fails on the unmodified `main` baseline and passes with this change. `./.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/fileservice` `GOWORK=off go build -mod=readonly ./pkg/fileservice` `GOWORK=off go vet -mod=readonly ./pkg/fileservice` `go build ./cmd/mo-service` `make static-check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…in#27548) ## 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: issue matrixorigin#27362 ## What this PR does / why we need it: FileService installs a caching DNS resolver for object storage and HDFS clients. Its package initializer also assigned that resolver to `net.DefaultResolver`, which unintentionally made the FileService cache process-wide. This affects unrelated clients such as MORPC/goetty. When a service keeps the same DNS name but moves to a new IP, a replacement MORPC backend performs a new dial but can still receive the old address from the FileService resolver until the DNS record TTL expires. In the Docker reproduction, the embedded DNS TTL was 600 seconds, so CN, TN, and Proxy continued dialing the unreachable LogService IP after the endpoint and system DNS had recovered. The MORPC backend replacement path itself remains valid and is not changed by this PR. This change only removes the process-wide resolver assignment. FileService's `httpDialer` continues to use the same caching resolver explicitly, so S3 SDKs, HDFS, and the FileService HTTP transport keep their existing DNS caching behavior. The regression test verifies both ownership boundaries: - FileService does not replace `net.DefaultResolver`. - FileService's own dialer still uses its caching resolver. There are no configuration, wire-format, retry-policy, or persistent-state changes. Normal active connections are unaffected; the behavioral difference is limited to future non-FileService dials, which now use Go's standard resolver and can observe endpoint IP changes. Tested with: `TestDNSResolverScope` fails on the unmodified `main` baseline and passes with this change. `./.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/fileservice` `GOWORK=off go build -mod=readonly ./pkg/fileservice` `GOWORK=off go vet -mod=readonly ./pkg/fileservice` `go build ./cmd/mo-service` `make static-check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…in#27548) ## 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: issue matrixorigin#27362 ## What this PR does / why we need it: FileService installs a caching DNS resolver for object storage and HDFS clients. Its package initializer also assigned that resolver to `net.DefaultResolver`, which unintentionally made the FileService cache process-wide. This affects unrelated clients such as MORPC/goetty. When a service keeps the same DNS name but moves to a new IP, a replacement MORPC backend performs a new dial but can still receive the old address from the FileService resolver until the DNS record TTL expires. In the Docker reproduction, the embedded DNS TTL was 600 seconds, so CN, TN, and Proxy continued dialing the unreachable LogService IP after the endpoint and system DNS had recovered. The MORPC backend replacement path itself remains valid and is not changed by this PR. This change only removes the process-wide resolver assignment. FileService's `httpDialer` continues to use the same caching resolver explicitly, so S3 SDKs, HDFS, and the FileService HTTP transport keep their existing DNS caching behavior. The regression test verifies both ownership boundaries: - FileService does not replace `net.DefaultResolver`. - FileService's own dialer still uses its caching resolver. There are no configuration, wire-format, retry-policy, or persistent-state changes. Normal active connections are unaffected; the behavioral difference is limited to future non-FileService dials, which now use Go's standard resolver and can observe endpoint IP changes. Tested with: `TestDNSResolverScope` fails on the unmodified `main` baseline and passes with this change. `./.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/fileservice` `GOWORK=off go build -mod=readonly ./pkg/fileservice` `GOWORK=off go vet -mod=readonly ./pkg/fileservice` `go build ./cmd/mo-service` `make static-check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #27362
What this PR does / why we need it:
FileService installs a caching DNS resolver for object storage and HDFS clients. Its package initializer also assigned that resolver to
net.DefaultResolver, which unintentionally made the FileService cache process-wide.This affects unrelated clients such as MORPC/goetty. When a service keeps the same DNS name but moves to a new IP, a replacement MORPC backend performs a new dial but can still receive the old address from the FileService resolver until the DNS record TTL expires. In the Docker reproduction, the embedded DNS TTL was 600 seconds, so CN, TN, and Proxy continued dialing the unreachable LogService IP after the endpoint and system DNS had recovered.
The MORPC backend replacement path itself remains valid and is not changed by this PR. This change only removes the process-wide resolver assignment. FileService's
httpDialercontinues to use the same caching resolver explicitly, so S3 SDKs, HDFS, and the FileService HTTP transport keep their existing DNS caching behavior.The regression test verifies both ownership boundaries:
net.DefaultResolver.There are no configuration, wire-format, retry-policy, or persistent-state changes. Normal active connections are unaffected; the behavioral difference is limited to future non-FileService dials, which now use Go's standard resolver and can observe endpoint IP changes.
Tested with:
TestDNSResolverScopefails on the unmodifiedmainbaseline and passes with this change../.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/fileserviceGOWORK=off go build -mod=readonly ./pkg/fileserviceGOWORK=off go vet -mod=readonly ./pkg/fileservicego build ./cmd/mo-servicemake static-check