apple / servicetalk

A networking framework that evolves with your application
https://docs.servicetalk.io
Apache License 2.0
927 stars 181 forks source link

http-netty: Add phantom reference version of watchdog filters #3084

Closed bryce-anderson closed 1 week ago

bryce-anderson commented 3 weeks ago

Motivation

The current watchdog filters are not exact: they don't account for responses that get drained later than the cleaner expects which can result in false positives. Because of this they can't proactively drain the responses.

Modifications

Add a PhantomReference variant of the watchdog filters. This filter uses a PhantomReference based implementation to be certain the response has been abandoned. Because we can now be certain, we can also proactively drain the response.

bryce-anderson commented 1 week ago

It looks like we found the root issue in https://github.com/apple/servicetalk/pull/3095 so the value of this is substantially diminished. That, combined with the desire to put it even lower in the stack means we should shelve this for now and we can always bring it back if we need to.