Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash sending window increment after close #95

Merged
merged 1 commit into from Sep 27, 2021

Conversation

Lukasa
Copy link
Collaborator

@Lukasa Lukasa commented Sep 27, 2021

Motivation:

When reads have yet to be delivered to a channel and we receive a
CHANNEL_CLOSE message, we forcibly deliver all of the reads. As part of
doing this, we process the window size changes and potentially send
window increment messages. These messages are invalid to send at this
time, and the state machine rightly forbids us from sending them, which
causes a crash.

Modifications:

  • Change the code to only futz with the channel window if the channel is
    still open.

Result:

No crashing after channel close.

Motivation:

When reads have yet to be delivered to a channel and we receive a
CHANNEL_CLOSE message, we forcibly deliver all of the reads. As part of
doing this, we process the window size changes and potentially send
window increment messages. These messages are invalid to send at this
time, and the state machine rightly forbids us from sending them, which
causes a crash.

Modifications:

- Change the code to only futz with the channel window if the channel is
  still open.

Result:

No crashing after channel close.
@Lukasa Lukasa added the patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1) label Sep 27, 2021
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

LGTM

@Lukasa Lukasa merged commit e212169 into apple:main Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants