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 closing readable twice sometimes on session disconnect #255

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

masad-frost
Copy link
Member

Why

Seeing this case sometimes where:

  1. Stream created
  2. Server closes
  3. Session disconnect
  4. Leads to an uncaught error

There aren't any real side-effects from this AFAICT, but it's a bug

What changed

  • Fixed the issue, only close the readable if it hasn't been closed already
  • Added a check elsewhere that doesn't have a guard around closeRedable

Versioning

  • Breaking protocol change
  • Breaking ts/js API change

@masad-frost masad-frost requested a review from a team as a code owner August 16, 2024 22:43
@masad-frost masad-frost requested review from Monkatraz and removed request for a team August 16, 2024 22:43
Comment on lines +446 to +452
if (resReadable.isClosed()) {
transport.log?.error(
'received stream close but readable was already closed',
);
} else {
closeReadable();
}
Copy link
Member Author

Choose a reason for hiding this comment

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

never ran into this, but thought i'd log

@masad-frost masad-frost merged commit 9fef263 into main Aug 16, 2024
4 checks passed
@masad-frost masad-frost deleted the fm-readable-close-twice branch August 16, 2024 22:45
@masad-frost masad-frost mentioned this pull request Aug 19, 2024
masad-frost added a commit that referenced this pull request Aug 19, 2024
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.

2 participants