He-Pin commented on code in PR #1264:
URL: https://github.com/apache/pekko-http/pull/1264#discussion_r3995759976
##########
http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/Http2ServerSpec.scala:
##########
@@ -657,6 +669,10 @@ class Http2ServerSpec extends Http2SpecWithMaterializer("""
})
"fail if more data is received than stream-level window
allows".inAssertAllStagesStopped(
new WaitingForRequestData {
+ // the single frame below is deliberately bigger than the
stream-level buffer, and so also bigger than the
+ // default max-frame-size; raise that limit so the frame reaches
the flow-control check this test is about
+ override def settings: ServerSettings =
super.settings.mapHttp2Settings(_.withMaxFrameSize(1024 * 1024))
Review Comment:
One more test needs this same override: `"release connection-level flow
control accounting when a stream-level window is exceeded"`, a few tests below
this one. It sends the identical single `512001`-byte `DataFrame` and only
overrides `withIncomingConnectionLevelBufferSize`, so with `max-frame-size =
512kB` (HOCON `kB` = 1000, i.e. 512,000) the frame is now rejected here with
`GOAWAY(FRAME_SIZE_ERROR)` instead of reaching the flow-control check, and
`expectRST_STREAM(TheStreamId, FLOW_CONTROL_ERROR)` plus the window assertion
below it both fail.
#1281 added that test on Sep 11, eleven days after these commits, and the PR
still reports `MERGEABLE` since the hunks do not overlap — so it only breaks
after merge. The PR body's "it was the only test in the suite that needed
adjusting" needs updating as well.
##########
http-core/src/main/mima-filters/2.0.x.backwards.excludes/max-frame-size.excludes:
##########
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# new max-frame-size setting
+ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.Http2ClientSettings.maxFrameSize")
+ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.Http2ServerSettings.withMaxFrameSize")
+ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.Http2ClientSettings.maxFrameSize")
+ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.Http2ServerSettings.maxFrameSize")
Review Comment:
Two filters short of the precedent for this exact change shape.
`http2-max-header-list-size.excludes` (#1216 — same structure: a new abstract
javadsl/scaladsl member pair plus their concrete companions) carries six, and
two of them cover concrete javadsl members that this file omits:
```
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.Http2ClientSettings.withMaxFrameSize")
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.Http2ServerSettings.getMaxFrameSize")
```
MiMa reports `ReversedMissingMethodProblem` for additions to traits even
when they have a body, which is why #1216 filtered `withMaxHeaderListSize` and
`getMaxHeaderListSize` despite both being concrete. The PR body records only
`sbt http-core/mimaReportBinaryIssues`, not the cross-build
`+mimaReportBinaryIssues` that CI runs — please re-run that after adding these.
##########
http-core/src/main/resources/reference.conf:
##########
@@ -254,6 +254,20 @@ pekko.http {
# effective limit for a well-behaved peer is somewhat stricter than the
configured value.
max-header-list-size = 64 KiB
+ # The largest frame payload this endpoint accepts, in bytes. A larger
incoming frame is rejected with a
+ # FRAME_SIZE_ERROR on its frame header, before the payload is buffered,
so this bounds how much a single frame
+ # can make this endpoint hold at once. The length field of a frame
header allows up to 16 MiB - 1.
+ #
+ # This is a limit, not an invitation: no larger SETTINGS_MAX_FRAME_SIZE
is advertised, so a peer that follows
+ # the spec keeps to the 16 KiB default of RFC 9113, section 4.2 and the
extra room here is only leniency for
+ # peers that do not. Advertising a value far above the initial 64 KiB
flow-control window would invite frames
+ # that cannot be received without breaking flow control anyway.
+ #
+ # RFC 9113, section 4.2 constrains this to be between 16 KiB and 16 MiB
- 1. The amount of request data
+ # buffered overall is bounded separately by the
incoming-connection-level-buffer-size and
+ # incoming-stream-level-buffer-size settings above.
Review Comment:
Nit: `incoming-connection-level-buffer-size` and
`incoming-stream-level-buffer-size` are defined *below* this block, not above —
`max-frame-size` sits right after `max-header-list-size`. Same wording in the
client block further down.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]