Skip to content

Conversation

vegas503
Copy link

What was wrong?

Issue #931

How was it fixed?

Added handling of FIN & RST flags in WINDOW_UPDATE frames.

To-Do

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

@paschal533
Copy link
Contributor

Hi @vegas503, The fix looks correct overall. Would you be able to add some unit tests for this? Specifically testing WINDOW_UPDATE frames with FLAG_FIN and FLAG_RST.
One question: have you tested this with any real yamux implementations to make sure the behavior matches expectations?
Overall this looks like a solid fix for a real spec compliance issue. Once we address the testing and potential refactoring, I think this will be ready to merge. Well done @vegas503 🙌

@seetadev
Copy link
Contributor

Thanks @vegas503 for identifying and fixing this important spec compliance issue, and @paschal533 for the thoughtful review and feedback 🙏

The added handling of FIN & RST flags in WINDOW_UPDATE frames is a solid improvement, and the suggestions around unit testing and validation against real yamux implementations will help ensure correctness and stability.

Great collaboration here — once the tests and cleanup are in place, this will be a strong addition to the codebase.

CCing @acul71 , @lla-dane and @sumanjeet0012 for peer review and feedback.

Copy link
Contributor

@acul71 acul71 left a comment

Choose a reason for hiding this comment

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

PR Review: Respect FLAG_FIN & FLAG_RST in TYPE_WINDOW_UPDATE frames (#932)

Summary

This PR addresses a spec compliance issue in the yamux implementation where FLAG_FIN and FLAG_RST flags in TYPE_WINDOW_UPDATE frames were not being properly handled.

Spec Verification: The yamux specification explicitly states:

  • 0x4 FIN - Performs a half-close of a stream. May be sent with a data message or window update.
  • 0x8 RST - Reset a stream immediately. May be sent with a data or window update message.
  • "To close a stream, either side sends a data or window update frame along with the FIN flag."

Changes Made

  • Added handling for FLAG_FIN in TYPE_WINDOW_UPDATE frames (lines 664-672)
  • Added handling for FLAG_RST in TYPE_WINDOW_UPDATE frames (line 579)
  • Both flags now properly trigger stream state changes (recv_closed for FIN, reset for RST)

Code Quality

Good: The fix follows existing patterns in the codebase
Good: Proper logging and stream state management
Good: Thread-safe implementation with appropriate locks

Concerns

⚠️ Missing: No unit tests for WINDOW_UPDATE frames with FLAG_FIN/FLAG_RST (existing tests only cover basic WINDOW_UPDATE without flags)
⚠️ Missing: No validation against real yamux implementations
⚠️ Missing: Documentation updates for the changes

Recommendation

Approve with conditions: The fix appears correct and addresses a real spec compliance issue. However, unit tests should be added before merging to ensure the behavior works as expected and to prevent regressions.

Follow-up Actions

  1. Add unit tests for WINDOW_UPDATE frames with FLAG_FIN and FLAG_RST
  2. Test against real yamux implementations for validation
  3. Update relevant documentation
  4. Clean up commit history as mentioned in the PR description

@acul71
Copy link
Contributor

acul71 commented Sep 29, 2025

@vegas503 what's the status of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants