GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: Sync the id when DefaultHttp2FrameStream's stream is updated. by He-Pin · Pull Request #14803 · netty/netty

Conversation

@He-Pin

@He-Pin He-Pin commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

Motivation:

Keep the id in sync

Modification:

update the id when stream is updated.

Result:

Fixes #14801

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@He-Pin
chore: Sync the id when DefaultHttp2FrameStream's stream is updated.
eb4dd8f
normanmaurer
normanmaurer reviewed Feb 12, 2025
View reviewed changes
Comment thread codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java
DefaultHttp2FrameStream setStreamAndProperty(PropertyKey streamKey, Http2Stream stream) {
assert id == -1 || stream.id() == id;
this.stream = stream;
this.id = stream.id();

@normanmaurer normanmaurer Feb 12, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

hmm... There must be a bug then as we actually guard against this in the assert above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@He-Pin He-Pin Feb 12, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

    private void onStreamActive0(Http2Stream stream) {
        if (stream.id() != Http2CodecUtil.HTTP_UPGRADE_STREAM_ID &&
                connection().local().isValidStreamId(stream.id())) {
            return;
        }

        DefaultHttp2FrameStream stream2 = newStream().setStreamAndProperty(streamKey, stream); //see here
        onHttp2StreamStateChanged(ctx, stream2);
    }

in Http2FrameCodec

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@normanmaurer normanmaurer Feb 12, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't get it... What I mean is the assert above basically should trigger. So either the assert is wrong or something else is fishy..

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@He-Pin He-Pin Feb 12, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

the newStream call creates a new DefaultHttp2FrameStream which id is -1 and the assert will pass when you first call setStreamAndProperty, I think the code is right, just not handy when you do debug which shows -1 in debugger.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@normanmaurer normanmaurer Feb 13, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Ah got it...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@normanmaurer
normanmaurer merged commit 34011b5 into netty:4.1 Feb 13, 2025
normanmaurer pushed a commit that referenced this pull request Feb 13, 2025
@He-Pin @normanmaurer
chore: Sync the id when DefaultHttp2FrameStream's stream is updated. (#…
cc2d076
…14803)

Motivation:

Keep the id in sync

Modification:

update the id when stream is updated.

Result:

Fixes #14801
normanmaurer pushed a commit that referenced this pull request Feb 13, 2025
@He-Pin @normanmaurer
chore: Sync the id when DefaultHttp2FrameStream's stream is updated. (#…
36d7d7d
…14803)

Motivation:

Keep the id in sync

Modification:

update the id when stream is updated.

Result:

Fixes #14801
@normanmaurer normanmaurer added this to the 4.1.118.Final milestone Feb 13, 2025
@normanmaurer normanmaurer mentioned this pull request Feb 13, 2025
chore: Sync the id when DefaultHttp2FrameStream's stream is updated. … #14813
Merged
normanmaurer added a commit that referenced this pull request Feb 13, 2025
@normanmaurer @He-Pin
chore: Sync the id when DefaultHttp2FrameStream's stream is updated. … (
3517081
#14813)

…(#14803)

Motivation:

Keep the id in sync

Modification:

update the id when stream is updated.

Result:

Fixes #14801

Co-authored-by: He-Pin(kerr) <[email protected]>
@normanmaurer normanmaurer modified the milestones: 4.1.118.Final, 4.1.119.Final Feb 13, 2025
This was referenced Sep 14, 2026
Http2: Reserve promised stream for PUSH_PROMISE after local RST_STREAM #17471
Closed
cache failure 1233e4a5 #17565
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer normanmaurer left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.1.119.Final

Development

Successfully merging this pull request may close these issues.

DefaultHttp2FrameStream's id is not sync with stream

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@He-Pin @normanmaurer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.