Copilot commented on code in PR #673: URL: https://github.com/apache/skywalking-banyandb/pull/673#discussion_r2097178728
########## banyand/liaison/http/server.go: ########## @@ -372,9 +382,13 @@ func (p *server) GracefulStop() { if p.grpcTLSReloader != nil { p.grpcTLSReloader.Stop() } - if p.grpcCancel != nil { - p.grpcCancel() + + p.grpcMu.Lock() + if cancel := p.grpcCancel; cancel != nil { + cancel() } + p.grpcMu.Unlock() Review Comment: Consider storing the cancel function in a local variable and releasing the lock before calling it in GracefulStop to prevent potential deadlocks if the cancel function blocks. ```suggestion var cancel context.CancelFunc if p.grpcCancel != nil { cancel = p.grpcCancel } p.grpcMu.Unlock() if cancel != nil { cancel() } ``` -- 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-unsubscr...@skywalking.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org