Remove directories leftover from improper shutdown so sage-cleaner won't kill random processes#35204
Conversation
|
I was hit by this bug and I wasn't able to even start sage. I found the ticket with a ready to review patch. I cherry-picked the commit into my current sage and voila: everything worked. I looked at the code and comments, and I think it's a good solution so I'm giving it a positive review. Component: scripts Keywords: sage-cleaner Author: Andy Howell |
|
Documentation preview for this PR is ready! 🎉 |
Codecov ReportBase: 88.60% // Head: 88.59% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #35204 +/- ##
===========================================
- Coverage 88.60% 88.59% -0.01%
===========================================
Files 2140 2140
Lines 397273 397273
===========================================
- Hits 352004 351966 -38
- Misses 45269 45307 +38
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
📚 Description
From #27769:
Under rare conditions, sage is killed at startup by sage-cleaner.
This requires:
When sage-cleaner tries to clean up, it will do a "kill 0", which will kill sage.
Files will only be left in ~/.sage/temp/HOSTNAME if sage is not shutdown properly. Most likely because of a reboot.
Even if the situation doesn't result on a "kill 0", sage-cleaner would still go on a killing spree for random processes which is awful.
The current PR removes everything under ~/.sage/temp/HOSTNAME/ at sage-cleaner startup so this doesn't happen.
Since sage-cleaner won't run more than once at a time, this seems safe.
Fixes #27769
📝 Checklist