FLUME-656: Flume node deadlocks on roll sink rotate with failing subsink

Review Request #1813 - Created June 14, 2011 and submitted

Jonathan Hsieh
old-flume
flume-656
flume
aaron, ahmed, arvind, esammer
Flume would essentially deadlock in the situation where a rotate/roll gets blocked (say when a down stream connection goes down and isn't up) and block further appends and metrics reads (since the previous version used intrisic locks).    This replaces the intrinsic with an RWLock (this guards the roll subsink reference: W lock for open / close, R lock for metrics and append ).  Close now also uses lockInterruptably() and will interrupt/cancel if it waits too long.  In order to get the thread that append call is being made in (thus the thread we need to interrupt) we use a executor service and a future. 

I'm not proud of the use of the future and am open to alternate ways of getting that thread. 
Tests pass.  
Loading...