Repository navigation
Commit 7761c62
Send setParserPaused straight to the end of the codec filter chain
Summary:
Finishes the part of D120517427 that was dropped. Picks up the `setParserPaused` half of D122722345 by willwang1; the `getTransportDirection` half already landed in D120517427 through the cached codec traits.
`HTTPSession::processReadData` calls `codec_.setParserPaused(false)` before every `onIngress`, and the call used to walk every filter in the chain, each one just forwarding `call_->setParserPaused(paused)`. Now `HTTPCodecFilterChain::setParserPaused` calls the codec at the end of the chain directly.
To keep that correct, filters no longer take part in `setParserPaused`:
- `HTTPCodecFilter` is now a class on top of `GenericFilter` with an empty `final` `setParserPaused`. No filter can override it, whatever it derives from, and a filter called directly ignores it.
- `HTTPCodecFilterChain::add` and `addFilters` require `std::derived_from<Filter, HTTPCodecFilter>`, so a raw `GenericFilter` cannot get into the chain. `foreach` hands out `HTTPCodecFilter*`, so existing `FilterIteratorFn` callers are unchanged.
- `chainEnd_` changes only in `setDestination`, so the chain always reaches the current codec.
No filter in fbsource overrides `setParserPaused`, and nothing outside the chain calls it on a filter.
Perf (from D122722345): Strobelight puts stacks through `PassThroughHTTPCodecFilter::setParserPaused` at about $148K a year fleet-wide, about 96% of it the forwarding itself. On proxygen/olb_internet, `HTTPCodecFilterChain::setParserPaused` is about 0.165% of CPU.
Reviewed By: hanidamlaj
Differential Revision: D123003021
fbshipit-source-id: ed2aeafd7c22d4ad4ba35cd469d5f7ede217dc8b1 parent e580c8a commit 7761c62
3 files changed
Lines changed: 31 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
| |||
107 | 118 | | |
108 | 119 | | |
109 | 120 | | |
110 | | - | |
111 | | - | |
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
| |||
252 | 261 | | |
253 | 262 | | |
254 | 263 | | |
255 | | - | |
| 264 | + | |
256 | 265 | | |
257 | 266 | | |
258 | 267 | | |
| |||
434 | 443 | | |
435 | 444 | | |
436 | 445 | | |
437 | | - | |
| 446 | + | |
438 | 447 | | |
439 | 448 | | |
440 | 449 | | |
441 | 450 | | |
442 | | - | |
443 | | - | |
444 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
445 | 454 | | |
446 | 455 | | |
447 | 456 | | |
448 | 457 | | |
449 | | - | |
| 458 | + | |
| 459 | + | |
450 | 460 | | |
451 | 461 | | |
452 | 462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
| |||
0 commit comments