From ca582a147f564b8e52e7db5e118738cec47fa51f Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Wed, 17 Jun 2026 21:35:49 +0800 Subject: [PATCH] fix: set StateReady after temporary accept error retry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Accept() returns a transient error, the service enters StateFailed, sleeps for the retry delay, then loops back to Accept(). Previously the state stayed StateFailed until the next successful Accept() — which could take arbitrarily long for idle services, making status observers see a stale 'error' even though the service has already reconnected and is ready. Now set StateReady (and clear lastError) immediately after the retry sleep. The redundant state transition on successful Accept is removed since recovery is handled once after the sleep. --- service/service.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/service/service.go b/service/service.go index 73407ef7..44ca9369 100644 --- a/service/service.go +++ b/service/service.go @@ -250,8 +250,6 @@ func (s *defaultService) Serve() error { if tempDelay > 0 { tempDelay = 0 - s.setState(StateReady) - s.status.setLastError(nil) } ctx := gctx