From 130e95e226110afbfbe188aa59a50c8bff2d11fc Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 27 Apr 2026 17:29:48 -0700 Subject: [PATCH] G5-5C #6.1: doc-fix Stop vs StopHard production/test guidance per Batch 6 review Architect Batch 6 review 2026-04-27 follow-up: clarify in code that Stop is the production shutdown path; StopHard is for test fault-injection / emergency stop only. Prevents future misuse where operators reach for StopHard as a default shutdown route, masking graceful-drain bugs. No code change. No test change. --- seaweed-block/core/transport/replica.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/seaweed-block/core/transport/replica.go b/seaweed-block/core/transport/replica.go index 1e3ec0f4b9..41b421f496 100644 --- a/seaweed-block/core/transport/replica.go +++ b/seaweed-block/core/transport/replica.go @@ -112,6 +112,14 @@ func (r *ReplicaListener) Serve() { // the conn or sends a frame; if you need to force handler exit // regardless of remote state (e.g., simulating replica-process death // in tests), use StopHard. +// +// Production / operational guidance: prefer Stop for normal shutdown +// (process exit, role change, volume close) — handlers exit cleanly +// after the OS-level FIN/RST from the remote primary's process exit +// or transport timeout. StopHard is intended for test fault-injection +// and exceptional emergency-stop paths only; using it as the default +// shutdown route on production deployments would mask graceful-drain +// bugs that real-world primaries depend on. func (r *ReplicaListener) Stop() { select { case <-r.stopCh: