[
https://issues.apache.org/jira/browse/FLUME-2259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13844464#comment-13844464
]
Hari Shreedharan commented on FLUME-2259:
-----------------------------------------
[~gopinathan.av] - This looks good in general. There is a small problem with
the patch though. It is possible that the tx.close gets called without a
tx.rollback if a failure happens in the try block and not in putEventsAndCommit
method. For example, if channel.take() or serializer.getActions() throws an
exception. We must handle this case. One way of doing this is by not doing the
rollback in the putEventsAndCommit method, instead allowing the exception
thrown in that method to get thrown into the process method where we catch it
and rollback and then close.
> transaction closure not happening for all the scenario in hbasesink
> --------------------------------------------------------------------
>
> Key: FLUME-2259
> URL: https://issues.apache.org/jira/browse/FLUME-2259
> Project: Flume
> Issue Type: Bug
> Components: Sinks+Sources
> Reporter: Gopinathan A
> Attachments: FLUME-2259.patch
>
>
> Hbase sink will not close the transaction if any error occurs like below
> {noformat}
> 06 Dec 2013 12:04:50,466 ERROR
> [SinkRunner-PollingRunner-DefaultSinkProcessor]
> (org.apache.flume.SinkRunner$PollingRunner.run:160) - Unable to deliver
> event. Exception follows.
> org.apache.flume.ChannelException: Failed to obtain lock for writing to the
> log. Try increasing the log write timeout value. [channel=c1]
> at
> org.apache.flume.channel.file.FileChannel$FileBackedTransaction.doTake(FileChannel.java:512)
> at
> org.apache.flume.channel.BasicTransactionSemantics.take(BasicTransactionSemantics.java:113)
> at
> org.apache.flume.channel.BasicChannelSemantics.take(BasicChannelSemantics.java:95)
> at org.apache.flume.sink.hbase.HBaseSink.process(HBaseSink.java:239)
> at
> org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
> at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
> at java.lang.Thread.run(Thread.java:662)
> {noformat}
> This will cause hbase sink to become non operative.
> {noformat}
> java.lang.IllegalStateException: begin() called when transaction is OPEN!
> at
> com.google.common.base.Preconditions.checkState(Preconditions.java:149)
> at
> org.apache.flume.channel.BasicTransactionSemantics.begin(BasicTransactionSemantics.java:131)
> at org.apache.flume.sink.hbase.HBaseSink.process(HBaseSink.java:236)
> at
> org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
> at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
> at java.lang.Thread.run(Thread.java:662)
> 04 Dec 2013 16:55:38,553 ERROR
> [SinkRunner-PollingRunner-DefaultSinkProcessor]
> (org.apache.flume.SinkRunner$PollingRunner.run:160) - Unable to deliver
> event. Exception follows.
> java.lang.IllegalStateException: begin() called when transaction is OPEN!
> at
> com.google.common.base.Preconditions.checkState(Preconditions.java:149)
> at
> org.apache.flume.channel.BasicTransactionSemantics.begin(BasicTransactionSemantics.java:131)
> at org.apache.flume.sink.hbase.HBaseSink.process(HBaseSink.java:236)
> at
> org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
> at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
> at java.lang.Thread.run(Thread.java:662)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)