fix: 积压时等本帧写出再断开并让 Shutdown 等待 0x8B

This commit is contained in:
Nixevol
2026-09-30 19:21:51 +08:00
parent 2d1dfd7cd8
commit ef46563f70
6 changed files with 375 additions and 22 deletions
+3 -1
View File
@@ -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)