Skip to content

fix(rmqctl): classify transport deadline errors as timeouts - #7114

Open
zmuxuny wants to merge 2 commits into
apache:rocketmq-studiofrom
zmuxuny:fix/cli-network-timeout-oct19
Open

zmuxuny wants to merge 2 commits into
apache:rocketmq-studiofrom
zmuxuny:fix/cli-network-timeout-oct19

Conversation

@zmuxuny

@zmuxuny zmuxuny commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Fixes #7111

Brief Description

Classify transport errors whose net.Error.Timeout() is true as TIMEOUT, instead of treating every network error as UNAVAILABLE. Socket/DNS deadlines need not wrap context.DeadlineExceeded; the existing context-only check therefore misses them.

The original error message is retained, with a network/responsiveness hint. Explicit CLI/API errors, context deadlines, and cancellation keep their existing precedence. Non-timeout transport errors remain UNAVAILABLE.

How Did You Test This Change?

On unchanged production code, three normalization cases fail (socket, DNS, and wrapped socket timeout), as do actual App.Execute regressions for table, JSON, and YAML output. All report UNAVAILABLE instead of TIMEOUT. The local injected RoundTripper never contacts a server.

Controls retain connection-refused, temporary non-timeout DNS, explicit CLI classification, context deadline, cancellation, and plain-error behavior.

On the final tree, with Go 1.27.1:

cd rmqctl
GOMAXPROCS=2 GOMEMLIMIT=384MiB GOFLAGS=-p=1 go test -race -count=1 -parallel 1 -timeout 60s ./...
GOMAXPROCS=2 GOMEMLIMIT=384MiB GOFLAGS=-p=1 make fmt vet build-all
git diff --check

All passed, including catalog freshness, all module packages/scripts, and all six supported platform builds with their generated license material checks.

Checklist

  • One coherent change, two existing files
  • Conventional Commit subject
  • Regression tests added; new test uses the Test suffix
  • Existing ASF headers retained; no new dependencies or UI strings
  • Independent production/test diff review completed
  • Backend architecture suite (mvn test), not run for this Go-only change

AI assistance was used for diagnosis, implementation, regression tests, independent review, and validation. No live Studio server or RocketMQ cluster was contacted.

@zmuxuny

zmuxuny commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Withdrawing this standalone patch to reduce review fragmentation. The timeout classification changes structured error codes, but no in-project consumer has been demonstrated to act differently on them, and retry, budget, and exit behavior are unchanged. The patch and branch are preserved for future focused CLI diagnostics work.

@zmuxuny zmuxuny closed this Oct 20, 2026
@zmuxuny zmuxuny reopened this Oct 20, 2026
Reuse the five-line ConsumerPage timer isolation from commit
381c5c4, credited to pilichoumao's
apache#6521. Keep production polling, all existing
assertions, and independent automatic-refresh coverage unchanged.

Signed-off-by: zmuxuny <xiahoumuxuan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant