fix: 积压时等本帧写出再断开并让 Shutdown 等待 0x8B
This commit is contained in:
+3
-1
@@ -335,7 +335,9 @@ func runServe(ctx context.Context, cfg config.Config) error {
|
||||
drainCancel()
|
||||
|
||||
shutCtx, shutCancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
_ = brk.Shutdown(shutCtx)
|
||||
if shutErr := brk.Shutdown(shutCtx); shutErr != nil && !errors.Is(shutErr, context.DeadlineExceeded) && !errors.Is(shutErr, context.Canceled) {
|
||||
slog.Error("broker shutdown", "err", shutErr)
|
||||
}
|
||||
shutCancel()
|
||||
|
||||
secondDrain := drainBudget - time.Since(drainStart)
|
||||
|
||||
Reference in New Issue
Block a user