bareos: master 9b4023d6

Author Committer Branch Timestamp Parent
Sebastian Sura Sebastian Sura master 2024-01-15 11:53 master 0abd660d Pending
Changeset append: fix possible deadlock

This construct enters into a deadlock if
1) the writer is waiting because the queue is full
2) the reader is waiting on the writer to quit

The reason is that this status is not communicated through the queue
but with a separate variable.

This commit makes it so the status is communicated only through the
queue itself. Special note has to be taken in the case of a timeout
in the reader (res == fd->Timeout) since normally this branch does not
look at the queue at all.

Because of this we needed to add a function the the channel that
actively checks whether the other side is still alive.
mod - core/src/lib/channel.h Diff File
mod - core/src/stored/append.cc Diff File