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

KTOR-8008 Fix uncaught exceptions in websocket pinger #4613

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

bjhham
Copy link
Contributor

@bjhham bjhham commented Jan 17, 2025

Subsystem
Core, I/O

Motivation
KTOR-8008 Uncaught cannot write to a channel errors from ws-pinger

Solution

  • Fixed the immediate problem by simply ignoring closed channel exceptions, since this is normal for the ping operation when it tries to write to a closed connection before cancellation.
  • Introduced sub-types for closed byte channel exceptions over the current IOException typealias approach to allow for more granular exception handling
  • Replaced the custom getter for CloseToken.cause with wrapCause() to be more explicit with the behavior.

@bjhham bjhham requested a review from e5l January 17, 2025 11:11
Copy link
Member

@osipxd osipxd left a comment

Choose a reason for hiding this comment

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

👍

Btw, is it that "impactful change"?

@bjhham bjhham enabled auto-merge (rebase) January 20, 2025 10:13
@bjhham
Copy link
Contributor Author

bjhham commented Jan 20, 2025

@osipxd I would say it's not an impactful change because the new exception types are still under the IOException hierarchy and the pinger catch clause should just bring the behaviour back to what was expected in earlier releases

@bjhham bjhham merged commit 3b44501 into main Jan 20, 2025
15 of 16 checks passed
@bjhham bjhham deleted the bjhham/pinger-failure-fix branch January 20, 2025 12:16
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.

3 participants