The GitHub Actions job "Validate and test" on 
pekko-http.git/throttle-http2-data-frames has succeeded.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
1c34209bfbb35f7f1eda80518e0b08582d4b0191 / PJ Fanning 
<[email protected]>
feat: allow empty HTTP/2 DATA frames to be throttled

Motivation:
A DATA frame carrying no payload has `sizeInWindow == 0`, so it
consumes no flow-control window. The number of such frames is
therefore not bounded by flow control at all, and on an open stream a
peer can send them continuously, each one costing a pass through the
stream state machine and a flow-control recompute. The
`frame-type-throttle` mechanism could not be pointed at them: it maps
an alias to a frame type name and had no alias for DATA, so DATA
frames were unthrottleable by configuration.

Adding a plain "data" alias would not have helped. Throttling every
DATA frame at the configured rate throttles legitimate throughput with
it, so nobody could enable it for this purpose. Only the empty frames
need it, because the data-carrying ones are already bounded by flow
control.

Modification:
Add an "empty-data" alias for the throttle that charges DATA frames
whose payload is empty. It resolves to a name that is deliberately not
a real frame type name, which `frameCost` recognises and applies to
empty DATA frames only. Off by default, like every throttle target
other than "reset".

Result:
An operator can throttle a flood of empty DATA frames without
throttling data-carrying ones.

Tests:
- sbt "http-core/testOnly 
org.apache.pekko.http.impl.engine.http2.Http2BlueprintSpec" - pass (11 tests), 
with a new case for the alias.
- sbt "http2-tests/testOnly 
org.apache.pekko.http.impl.engine.http2.Http2ServerEmptyDataThrottleSpec 
org.apache.pekko.http.impl.engine.http2.Http2ServerEnableFrameTypeThrottleSpec 
org.apache.pekko.http.impl.engine.http2.Http2ServerDisableFrameTypeThrottleSpec"
 - pass (3 tests); the new spec floods empty DATA frames with the throttle 
configured for them and requires the connection to be torn down. Verified it 
fails when the alias resolves to None, which is the behaviour before this 
change.
- sbt http-core/mimaReportBinaryIssues - pass

References:
Refs #332 - extends the frame type throttle to empty DATA frames

Report URL: https://github.com/apache/pekko-http/actions/runs/33417125259

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to