Logs: fix file-descriptor-sink race condition
Context
In File_descriptor_sink
module, when using daily-log
option, a file is created everyday to write logs on disk.
There could be a race condition if two events are emitted when the rotation occurs: one will remove the file and the other try to write on it.
The issue comes from the fact that reading the current state of sinks is not part of the critical section.
Manually testing the MR
use remy@sink-race-condition-debug-fail
to run a node and witness the Bad file descriptor
errors occuring.
use remy@sink-race-condition-debug
and ensure no error of this kind occures.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR
Edited by Rémy El Sibaïe