fix: prevent deadlock in Println/Printf after program shutdown - #1779
fix: prevent deadlock in Println/Printf after program shutdown#1779Ricardo-M-L wants to merge 2 commits into
Conversation
Use shutdown(true) instead of cancel() in the panic recovery path. Previously cancel() only cancelled the program context without cleaning up the renderer goroutine or closing the cancelReader, causing resource leaks when the program panics.
Use p.Send() instead of direct channel send so Println and Printf safely become no-ops once the program has exited, matching the behavior of Send(), Quit(), and the documented safety contract.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1779 +/- ##
==========================================
+ Coverage 56.50% 57.72% +1.22%
==========================================
Files 25 25
Lines 1315 1339 +24
==========================================
+ Hits 743 773 +30
+ Misses 482 476 -6
Partials 90 90 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Friendly ping - this PR is small and ready for review whenever there's bandwidth. What it fixes: Scope: 1 hunk in Overlap note: this branch also carries the |
Fix Program.Println() and Printf() which sent directly to p.msgs without context check, unlike Send(). After shutdown these calls blocked forever, violating the documented safety contract.