fix(locks): degrade instead of crashing on a poisoned grid lock#51
Open
roramirez wants to merge 1 commit into
Open
fix(locks): degrade instead of crashing on a poisoned grid lock#51roramirez wants to merge 1 commit into
roramirez wants to merge 1 commit into
Conversation
A panic in a parser thread while it holds a pane's grid write lock poisons that RwLock; every main-thread `.read()/.write().unwrap()` then panicked in cascade, taking down the whole app. Add poison-tolerant `Pane::grid_read` and `Pane::grid_write` helpers that log a warning and return `None`, and migrate the ~30 main-thread grid/log_file/pending_resize acquisitions (render, input, search, scroll, resize, restore, paste, toggle-log) to skip the frame/action on poison rather than panic. The parser thread's own writes are left as-is — a thread cannot observe poison it caused itself. Add a regression test that poisons the active pane's grid and confirms update_search_matches / active_grid_rows / scroll_up / scroll_top return degraded values without panicking.
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.
What
A panic in a parser thread while it holds a pane's grid write lock poisons that
RwLock; every main-thread.read()/.write().unwrap()then panicked in cascade, taking down the whole app.Changes
Pane::grid_read/Pane::grid_writehelpers that log a warning and returnNone.Tests
update_search_matches/active_grid_rows/scroll_up/scroll_topdegrade without panicking.Card
plan-todo/03-hardening-unwrap-locks.md