Skip to content

server-zd: tidy-ups from the #1182 review (swap order, stale gate comments, comment length) #1211

Open

Description

@longquanzheng

Observed

Small items found in review of #1182 (head 68bbcf3), after it merges. None changes correctness in normal runs.

  1. Swap order leaves a tiny window. swap_in_serving_instance in server-zd/crates/dexzd-server/src/server_node/node_lifecycle.rs calls GrpcServer::start_serving (whose task may serve at once) before standby_instance.refuse_public_calls_as_replaced(). A call on a standby connection sent after the serving instance answered its first call could still read the Starting gate state. Fix: call grpc.refuse_public_calls_as_replaced() before the std::mem::replace.
  2. Stale doc comments. server-zd/crates/dexzd-server/src/server_node/grpc_server.rs around line 63 ("Public services serve once activated") and line 93 ("answer UNAVAILABLE until activated"): a serving instance now serves from its start, and standby instances never serve. StartupService no longer describes what the gate does; consider a precise name such as PublicCallGate. Update only outdated references; keep the rest of each existing comment.
  3. R18 comment length. New comment blocks over 20 words: the doc comment near line 205–208 of server-zd/crates/dexzd-server/tests/serve_process/startup_calls.rs, and the doc comment of NodeGroup::note_serving_period in tests/serve_process/standby_failover/node_group.rs. Shorten them.
  4. Hypothesis, unverified: possible flake in standby_failover::step_down::step_down_keeps_the_answer_of_a_call_that_ends_before_the_release. The gate's biased select prefers period_end. If the RPC task ends in the drain but its handler has not returned when the release completes and end_public_calls runs (for example under a host stall), the call becomes UNAVAILABLE and the test fails. Check whether the InvokeRPC handler awaits anything after its RPC task ends; if so, make the test robust or make the handler complete before the release.

Acceptance

  • Items 1–3 fixed; make clippy, make rust-rules-check, and cargo test -p dexzd-server --test serve_process startup_calls pass.
  • Item 4: either a short note in the PR showing the window does not exist, or a fix with the test run 20 times locally without failure.

Activity

  1. added
    type:tech-debtRefactor or cleanup without behavior change
    P3Low priority; do when convenient
    size:SAbout a day or less
    codex-readySelf-contained; can be handed to a Codex worker as is
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority; do when convenientarea:server-zdComponent: server-zdcodex-readySelf-contained; can be handed to a Codex worker as issize:SAbout a day or lesstype:tech-debtRefactor or cleanup without behavior change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions