Skip to content

feat(rc-admin)!: add bounded client devnull diagnostics - #286

Merged
cxymds merged 2 commits into
mainfrom
cxymds/issue-1404-client-devnull
Jul 23, 2026
Merged

feat(rc-admin)!: add bounded client devnull diagnostics#286
cxymds merged 2 commits into
mainfrom
cxymds/issue-1404-client-devnull

Conversation

@cxymds

@cxymds cxymds commented Jul 21, 2026

Copy link
Copy Markdown
Member

Related issue

Closes rustfs/backlog#1404

Depends on the bounded diagnostic snapshots merged in #285.

Background and user impact

RustFS beta.10 implements one real active diagnostic performance route: client-to-server upload-to-devnull. Other object, network, and site speedtest families are incomplete or placeholder implementations. rc needs to expose only the measured route with strict load limits, fail-closed capability checks, cancellation, and no automatic retries.

Solution

  • Add rc admin diagnostics client-devnull ALIAS --size 8MiB --timeout 30s --concurrency 1 --yes.
  • Validate all input before capability discovery or active traffic.
  • Limit aggregate traffic to 64 MiB, concurrency to 1-4, and timeout to 1-60 seconds.
  • Generate a static zero body incrementally in 64 KiB chunks without allocating the full payload.
  • Set exact Content-Length and precompute the matching SHA-256 for SigV4 signing.
  • Fail closed on unknown or stubbed capability states before the active POST.
  • Never retry an active probe automatically.
  • Cancel peer requests and body production on timeout, Ctrl-C, or future abort.
  • Bound each active response or error body to 64 KiB.
  • Require kind=client-devnull, measured=true, exact rx_bytes, and finite positive duration and throughput.
  • Report requested and received bytes, concurrency, wall-clock elapsed time, and aggregate throughput through the existing output-v3 admin_operations family.

BREAKING contract note

BREAKING: This PR updates the protected docs/reference/rc/admin.md behavior contract for a new additive active diagnostics command. It does not change output v1/v2/v3 schemas, config schema, exit-code definitions, or existing command behavior. No schema migration is required.

Validation

Exact head: 73cc41fca3d34edd7bb743e7c871d531a153c673

  • cargo fmt --all --check
  • CARGO_BUILD_JOBS=2 cargo clippy --workspace -- -D warnings
  • CARGO_BUILD_JOBS=2 cargo test --workspace
  • Core client-devnull limits: 3 passed
  • S3 client-devnull: 9 passed
  • S3 read-only diagnostics regression: 3 passed
  • Combined CLI diagnostics: 13 passed in both lib and main targets
  • CLI request-capture integration: 1 passed
  • Cancellation regression: 20 consecutive targeted runs passed
  • Review audit: 0 reviews and 0 review threads

Limitations

  • Client-to-server devnull only.
  • Object speedtest, inter-node network speedtest, site speedtest, site-replication netperf, active drive benchmark, and continuous traffic generation are excluded.
  • The RustFS handler itself does not enforce a request-body size limit; this CLI guarantees that it sends no more than 64 MiB, but other callers must enforce their own limits.
  • Live configured-environment behavior remains covered by the repository compatibility workflow and GitHub checks; local validation uses source-backed contract and mock integration coverage.

@cxymds
cxymds changed the base branch from cxymds/issue-1400-diagnostic-snapshots to main July 21, 2026 17:18
@cxymds cxymds closed this Jul 21, 2026
@cxymds cxymds reopened this Jul 21, 2026
@cxymds
cxymds changed the base branch from main to cxymds/issue-1400-diagnostic-snapshots July 21, 2026 17:19
@cxymds

cxymds commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Validation is complete for exact head e16208271bf7a93b33d1b9b3bb854f2b2b1859ed.

Local gates on the final stacked commit:

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

Focused combined validation:

  • Core diagnostic contract: 6 passed.
  • CLI combined diagnostics: 13 passed in both lib and main targets.
  • S3 active probe: 8 passed, explicit abort: 1 passed, read-only diagnostics: 3 passed.
  • CLI request-capture integration: 1 passed.
  • Independent review, post-fix review, manual-restack review, and final wording review: no remaining findings.

Remote gates:

The draft PR is open and its true stacked base is restored to cxymds/issue-1400-diagnostic-snapshots (#285). The protected command-reference addition is declared as BREAKING.

A local live beta.10 container run was not performed because the Docker daemon is unavailable in this workspace; the validation claim is limited to the source-backed protocol audit, bounded mock/request-capture tests, local suites, and GitHub checks above.

@cxymds
cxymds force-pushed the cxymds/issue-1400-diagnostic-snapshots branch from 1fb67e1 to a1dcc7e Compare July 23, 2026 01:57
Base automatically changed from cxymds/issue-1400-diagnostic-snapshots to main July 23, 2026 02:05
@cxymds
cxymds force-pushed the cxymds/issue-1404-client-devnull branch from e162082 to dfdb835 Compare July 23, 2026 02:11
@cxymds
cxymds requested a review from overtrue July 23, 2026 02:11
@cxymds
cxymds marked this pull request as ready for review July 23, 2026 02:11
@cxymds

cxymds commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

CI follow-up for head 73cc41fca3d34edd7bb743e7c871d531a153c673:

The previous macOS test failure was a test synchronization timeout in aborting_client_devnull_closes_an_incomplete_upload. Under runner load, the 5-second channel wait expired before the active request reached the mock server; dropping the test task then caused the secondary "client closed connection before headers" panic. Ubuntu and Windows passed, and no production-path failure was observed.

The fix changes only the two test channel waits from 5 to 15 seconds. Production timeout, cancellation, upload, and traffic-limit behavior is unchanged.

Validation after the fix:

  • targeted cancellation test: 20 consecutive passes
  • cargo fmt --all --check
  • CARGO_BUILD_JOBS=2 cargo clippy --workspace -- -D warnings
  • CARGO_BUILD_JOBS=2 cargo test --workspace

The new GitHub checks are now authoritative.

@cxymds
cxymds merged commit daef6ac into main Jul 23, 2026
17 checks passed
@cxymds
cxymds deleted the cxymds/issue-1404-client-devnull branch July 23, 2026 02:34
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