Each stateless request now carries an entry-use record on its context; getServer counts the entry it hands out as active (under the path lock) and ServeHTTP releases it when the request ends, so a subscriptions/listen stream keeps its entry active for its whole life. Capacity eviction walks the LRU from the back and drops only idle entries, so it no longer ends a quiet listener or cancels a tool call in flight, and a revocation still finds every open stream. While every entry is busy the LRU stays above capacity until requests end. TestStatelessFanOut's LRU subtest now asserts that the listener's server is spared when the binding past capacity arrives (the oldest idle server goes instead) and that a revocation then still ends the stream.
11 KiB
11 KiB