You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "cvictory (via GitHub)" <gi...@apache.org> on 2026/05/11 04:31:46 UTC
[PR] fix(server): replace select{} in Serve() with graceful lifecycle management [dubbo-go]
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix(server): replace select{} in Serve() with graceful lifecycle management [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl closed pull request #3321: fix(server): replace select{} in Serve() with graceful lifecycle management
URL: https://github.com/apache/dubbo-go/pull/3321
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix(server): replace select{} in Serve() with graceful lifecycle management [dubbo-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3321:
URL: https://github.com/apache/dubbo-go/pull/3321#issuecomment-4417613822
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3321) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3321&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3321&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3321&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3321&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3321&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3321)
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix(server): replace select{} in Serve() with graceful lifecycle management [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on PR #3321:
URL: https://github.com/apache/dubbo-go/pull/3321#issuecomment-4701886891
this issue have been solved in #3293
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org