----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34965/#review91159 -----------------------------------------------------------
core/src/main/scala/kafka/server/AbstractFetcherThread.scala (line 71) <https://reviews.apache.org/r/34965/#comment144446> As you probably noticed synchronization in the AbstractFetcherManager/Thread classes are unfortunately pretty nightmarish. Since the simple consumer is force-closed without the SimpleConsumer’s lock consider the following sequence: - You call forceClose - In the mean time (before isClosed is set to true) an ongoing call to sendRequest recreates the connection - The fetcher thread will subsequently exit (since the ShutdownableThread’s isRunning flag is false) - So even though the SimpleConsumer is _closed_ at that point, the connection will remain Can you verify or is it a non-issue? core/src/main/scala/kafka/server/AbstractFetcherThread.scala <https://reviews.apache.org/r/34965/#comment144448> You could get around the above by retaining this call to simpleConsumer.close (although it would be mostly redundant). However this is still not ideal, since it is a caveat that the user of the (public) forceClose API needs to be aware of. - Joel Koshy On June 3, 2015, 10:30 p.m., Dong Lin wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34965/ > ----------------------------------------------------------- > > (Updated June 3, 2015, 10:30 p.m.) > > > Review request for kafka. > > > Bugs: KAFKA-2241 > https://issues.apache.org/jira/browse/KAFKA-2241 > > > Repository: kafka > > > Description > ------- > > KAFKA-2241; AbstractFetcherThread.shutdown() should not block on > ReadableByteChannel.read(buffer) > > > Diffs > ----- > > core/src/main/scala/kafka/consumer/SimpleConsumer.scala > 31a2639477bf66f9a05d2b9b07794572d7ec393b > core/src/main/scala/kafka/server/AbstractFetcherThread.scala > 83fc47417dd7fe4edf030217fa7fd69d99b170b0 > > Diff: https://reviews.apache.org/r/34965/diff/ > > > Testing > ------- > > > Thanks, > > Dong Lin > >