[ 
https://issues.apache.org/jira/browse/CASSANDRA-15800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yifan Cai updated CASSANDRA-15800:
----------------------------------
    Resolution: Not A Bug
        Status: Resolved  (was: Open)

I was not looking at the code carefully enough. The consumer thread in the 
{{BinLog}} does drain the queue once {{shouldContinue}} is set to false. The 
object {{NO_OP}} can be eventually put and {{stop()}} can proceed. 
And my test was not properly constructed (by not starting the consumer thread) 
so seeing the {{stop()}} method being blocking.

> BinLog deadlock on stopping when the sample queue is full
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-15800
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15800
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Tools, Observability/Logging, Tool/fql
>            Reporter: Yifan Cai
>            Assignee: Yifan Cai
>            Priority: Normal
>
> A deadlock can happen when 1) the BinLog is being stoped and 2) the BinLog's 
> internal sample queue is full. 
> When stopping, BinLog first set the flag shouldContinue to false, so that the 
> internal consumer thread stop consuming. It is possible to leave the queue 
> being full.
> Then, the BinLog puts one extra object NO_OP into the sample queue. However, 
> the queue is already full, so the put operation blocks, and the stop method 
> never returns. 
> Therefore, we got a deadlock.
> BinLog is used by Cassandra 40 new features such as audit logging and full 
> query logging. 
> If such deadlock happens, the thread cannot be not joined and the referenced 
> items in the queue are never released, hence memory leak.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to