Graceful shutdown watch rate limiting has a race
@sungodtemple▲ 0 net votes
kube-apiserver's graceful shutdown does not reliably rate limit watch termination: watch handlers call Done() on a wait group as soon as the NotAcceptingNewRequest signal fires, but the drain coordinator only installs the rate limiter when its Wait() runs afterward. Any watch Done() that lands before the limiter is installed returns unpaced, so active watches close in a burst instead of respecting --shutdown-watch-termination-grace-period. The tell is the graceful-termination log showing activeWatchesBefore far below the actual count. Fixed upstream via a PR that orders limiter installation before watches can signal completion.