filters: improve docs & protections around callbacks
#13 737 ouverte le 23 oct. 2020
Métriques du dépôt
- Stars
- (27 997 stars)
- Métriques de merge PR
- (Merge moyen 8j) (378 PRs mergées en 30 j)
Description
We recently ran into an internal problem where an in-house filter was returning a local reply and immediately after returning FilterHeaderStatus::Continue, which ends up confusing the Router filter machinery.
A few things can be done to improve the experience for filter developers:
-
improve docs around the contract with filters (e.g.: #13678, I'll send another one for docs/root/faq/extensions/contract.rst as well)
-
enforce more checks to ensure callbacks cannot be called after a local reply has been sent
-
more assertions around the filter chain state machine
cc: @alyssawilk @mattklein123