The downtime/comment table also contains the related host and service
object, which in turn, contains all the comment/downtimes for the
object. Due to this, when for example doing the following request:
GET comments\nColumns: host_comments
we would do a recursive call to DownCommColumn::output. This would
lead to a deadlock as the mutex lock is called twice, without unlocking.
To fix this issue we use a recursive mutex, which allows one thread to
run multiple locks on a single mutex.
The downtime/comment table also contains the related host and service object, which in turn, contains all the comment/downtimes for the object. Due to this, when for example doing the following request:
GET comments\nColumns: host_comments
we would do a recursive call toDownCommColumn::output
. This would lead to a deadlock as the mutex lock is called twice, without unlocking.To fix this issue we use a recursive mutex, which allows one thread to run multiple locks on a single mutex.
Also add a simple small testcase.
Signed-off-by: Jacob Hansen jhansen@op5.com