-
Couldn't load subscription status.
- Fork 55
Open
Description
Hello @daboross! I have identified a deadlock issue in fern that occurs intermittently when disk space is exhausted during logging operations.
The deadlock scenario:
- During active logging with fern, the stream lock is acquired
- The disk becomes full mid-write
- The code attempts to use backup logging (to stderr) while still holding the stream lock
- This creates a circular dependency in multi-threaded scenarios
To reproduce:
- I modified the
cmd-program.rsexample to include multi-threading (attached) - Used the disk-filling utility from https://www.cylog.org/utilities/filldisk.jsp
- Run the modified example while filling the disk
Proposed solution:
Release the stream lock before attempting error handling to prevent the circular dependency.
Do you have any thoughts, suggestions or alternatives to this proposed solution?
I've attached both the modified example and a thread dump showing the deadlock.
Let me know if you need any additional information or clarification. Happy to provide more details or discuss alternative solutions.
Thanks!

Metadata
Metadata
Assignees
Labels
No labels