Copilot commented on code in PR #96:
URL: 
https://github.com/apache/dubbo-go-pixiu-samples/pull/96#discussion_r2328964722


##########
dubbogo/simple/prometheus/test/pixiu_test.go:
##########
@@ -69,7 +68,7 @@ func TestLocal(t *testing.T) {
 
        go func() {
                server := &http.Server{Addr: ":9091", Handler: metricServer}
-               server.Shutdown(context.Background())
+               defer server.Shutdown(context.TODO())
                server.ListenAndServe()

Review Comment:
   The defer statement will execute server.Shutdown() when the goroutine 
function returns, but server.ListenAndServe() is a blocking call that only 
returns on error. This means the server will never be properly shut down. 
Consider removing the defer and implementing proper shutdown signaling, or move 
the shutdown call to after ListenAndServe() with error handling.



-- 
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