cvictory opened a new pull request, #3321:
URL: https://github.com/apache/dubbo-go/pull/3321

   ## Bug
   - Symptom: `Server.Serve()` uses `select {}` to block forever, making it 
impossible to shut down gracefully from code or respond to lifecycle signals.
   - Root cause: hard spin (`select {}`) has no termination path.
   
   ## Fix
   - Add `stopCh chan struct{}` to `Server` for lifecycle signaling.
   - `NewServer` initializes `stopCh`.
   - `Serve()` blocks on `<-stopCh` instead of `select{}`.
   - Add `Stop()` method: safe, idempotent, and allows `Serve()` to be called 
again after shutdown.
   - `Serve()` re-creates `stopCh` if previously closed, supporting restart.
   - Add `serve_stop_test.go` with 4 lifecycle tests (all pass).
   
   ## Verification
   - Regression tests: all 148 existing server tests pass.
   - New tests: `TestStopBeforeServe`, `TestStopIdempotent`, 
`TestServeStopGracefulShutdown`, `TestServeAfterStop` all pass.
   
   Fixes #3042


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to