Skip to content

8347373: HTTP/2 flow control checks may count unprocessed data twice#23018

Closed
dfuch wants to merge 2 commits intoopenjdk:masterfrom
dfuch:ImproveHttp2FlowControl
Closed

8347373: HTTP/2 flow control checks may count unprocessed data twice#23018
dfuch wants to merge 2 commits intoopenjdk:masterfrom
dfuch:ImproveHttp2FlowControl

Conversation

@dfuch
Copy link
Member

@dfuch dfuch commented Jan 9, 2025

The HTTP/2 flow control logic has a potential race condition where some of the unprocessed data may be counted twice for the connection window.
A protocol exception may be raised incorrectly if there are several concurrent streams producing data and the connection window is close from being exhausted.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8347373: HTTP/2 flow control checks may count unprocessed data twice (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23018/head:pull/23018
$ git checkout pull/23018

Update a local copy of the PR:
$ git checkout pull/23018
$ git pull https://git.openjdk.org/jdk.git pull/23018/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23018

View PR using the GUI difftool:
$ git pr show -t 23018

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23018.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 9, 2025

👋 Welcome back dfuchs! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 9, 2025

@dfuch This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8347373: HTTP/2 flow control checks may count unprocessed data twice

Reviewed-by: jpai

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 50 new commits pushed to the master branch:

  • beb0e60: 8347397: Cleanup of JDK-8169880
  • c5c4efd: 8347120: Launchers should not have java headers on include path
  • ec7393e: 8347287: JFR: Remove use of Security Manager
  • 12752b0: 8347346: Remove redundant ClassForName.java and test.policy from runtime/Dictionary
  • 57af52c: 8346581: JRadioButton/ButtonGroupFocusTest.java fails in CI on Linux
  • 1f45797: 8347124: Clean tests with --enable-linkable-runtime
  • 5e92a4c: 8347267: [macOS]: UnixOperatingSystem.c:67:40: runtime error: division by zero
  • 55c6904: 8331717: C2: Crash with SIGFPE Because Loop Predication Wrongly Hoists Division Requiring Zero Check
  • 1a0fe49: 8347256: Epsilon: Demote heap size and AlwaysPreTouch warnings to info level
  • 8b07617: 8347345: Remove redundant test policy file from ModelMBeanInfoSupport directory
  • ... and 40 more: https://git.openjdk.org/jdk/compare/55bcf4c054c95af2a073818cd8c392de02b3ee01...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 9, 2025
@openjdk
Copy link

openjdk bot commented Jan 9, 2025

@dfuch The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the net net-dev@openjdk.org label Jan 9, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 9, 2025

Webrevs

private boolean checkWindowSizeExceeded(long len) {
private boolean checkWindowSizeExceeded(long received, long len) {
// because windowSize is bound by Integer.MAX_VALUE
// we will never reach the point where received.get() + len
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - the method param received shadows the class level field and the comment that says "received.get()" would need to be reworded too. It might be better to rename the method param to something else.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I could rename it to processed.

int tosend = (int)Math.min(received.get(), Integer.MAX_VALUE);
if (tosend > limit) {
received.getAndAdd(-tosend);
received.addAndGet(-tosend);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing the change on this line is to merely be consistent with some others parts of the code in this class? Semantically, both these methods would be the same since we don't use the return value.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - I had added some println when debugging for which it was more convenient to call addAndGet than getAndAdd. As you say it's the same so I left it.

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated changes look good to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 10, 2025
@dfuch
Copy link
Member Author

dfuch commented Jan 13, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Jan 13, 2025

Going to push as commit 0612636.
Since your change was applied there have been 70 commits pushed to the master branch:

  • 450636a: 8347274: Gatherers.mapConcurrent exhibits undesired behavior under variable delays, interruption, and finishing
  • 82e2a79: 8347006: LoadRangeNode floats above array guard in arraycopy intrinsic
  • 85ed78c: 8345185: Update jpackage to not include service bindings by default
  • 3b9732e: 8345471: Clean up compiler/intrinsics/sha/cli tests
  • ed0b555: 8344035: Replace predicate walking code in Loop Unswitching with a predicate visitor
  • b37f123: 8347407: [BACKOUT] C1/C2 don't handle allocation failure properly during initialization (RuntimeStub::new_runtime_stub fatal crash)
  • 1f7925c: 8347270: Remove unix_getParentPidAndTimings, unix_getChildren and unix_getCmdlineAndUserInfo
  • 9fafd63: 8346828: javax/swing/JScrollBar/4865918/bug4865918.java still fails in CI
  • f04a642: 8346717: serviceability/dcmd/vm/SystemDumpMapTest.java failing on Windows with "Stack base not yet set for thread id"
  • 3145278: 8346727: JvmtiVTMSTransitionDisabler deadlock
  • ... and 60 more: https://git.openjdk.org/jdk/compare/55bcf4c054c95af2a073818cd8c392de02b3ee01...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 13, 2025
@openjdk openjdk bot closed this Jan 13, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 13, 2025
@openjdk
Copy link

openjdk bot commented Jan 13, 2025

@dfuch Pushed as commit 0612636.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated net net-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants