Fixed possible crash when draining writequeue
The write queue spinlock was released in dcb_write_tidy_up without first acquiring it. This caused a crash when two threads try to interact with the write queue at the same time.
This commit is contained in:
@ -1474,8 +1474,6 @@ dcb_log_write_failure(DCB *dcb, GWBUF *queue, int eno)
|
|||||||
static inline void
|
static inline void
|
||||||
dcb_write_tidy_up(DCB *dcb, bool below_water)
|
dcb_write_tidy_up(DCB *dcb, bool below_water)
|
||||||
{
|
{
|
||||||
spinlock_release(&dcb->writeqlock);
|
|
||||||
|
|
||||||
if (dcb->high_water && dcb->writeqlen > dcb->high_water && below_water)
|
if (dcb->high_water && dcb->writeqlen > dcb->high_water && below_water)
|
||||||
{
|
{
|
||||||
atomic_add(&dcb->stats.n_high_water, 1);
|
atomic_add(&dcb->stats.n_high_water, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user