Repository navigation
canvas: Fix response panic on closed channel - #45310
Merged
Merged
Conversation
Signed-off-by: shangguanmachine-dot <[email protected]>
shangguanmachine-dot
force-pushed
the
main
branch
from
June 2, 2026 14:31
e388347 to
cbb85bf
Compare
yezhizhen
approved these changes
Jun 2, 2026
yezhizhen
left a comment
Member
There was a problem hiding this comment.
I wonder if these can really fail. But nothing to lose by unwrap less.
Member
If you add a long sleep before the send, and close the page with the canvas during the sleep duration, that could be a reproducer. |
Member
|
Both of the usages are sync receives, so at least right now the send can't fail (unless script is panicking due to another reason in that short window), but unwrapping less is probably better. |
sagudev
approved these changes
Jun 2, 2026
jschwe
pushed a commit
to jschwe/servo
that referenced
this pull request
Jun 26, 2026
The canvas paint thread could panic when attempting to send responses through channels that have already been closed by the receiver Replace .unwrap() calls with proper error handling using if let Err(error). Log warnings instead of panicking when channel send operations fail. Part of servo#40744 Signed-off-by: shangguanmachine-dot <[email protected]> Co-authored-by: shangguanmachine-dot <[email protected]> (cherry picked from commit adb5c21)
jschwe
pushed a commit
that referenced
this pull request
Jun 26, 2026
The canvas paint thread could panic when attempting to send responses through channels that have already been closed by the receiver Replace .unwrap() calls with proper error handling using if let Err(error). Log warnings instead of panicking when channel send operations fail. Part of #40744 Signed-off-by: shangguanmachine-dot <[email protected]> Co-authored-by: shangguanmachine-dot <[email protected]> (cherry picked from commit adb5c21)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The canvas paint thread could panic when attempting to send responses through channels that have already been closed by the receiver
Replace .unwrap() calls with proper error handling using if let Err(error). Log warnings instead of panicking when channel send operations fail.
Part of #40744