[
https://issues.apache.org/jira/browse/FLUME-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266713#comment-13266713
]
[email protected] commented on FLUME-1131:
------------------------------------------------------
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4837/#review7474
-----------------------------------------------------------
Thanks for the patch Brock. Changes look good. I do have my tx-nit request
below for you to consider. Also noted some other feedback.
flume-ng-core/src/main/java/org/apache/flume/channel/ChannelProcessor.java
<https://reviews.apache.org/r/4837/#comment16519>
Perhaps this is equivalent to:
...
} catch (Throwable th) {
if (tx != null) {
try {
tx.rollback();
} catch (Exception ex) {
LOG.warn("exception...", ex);
}
}
Throwables.propagate(th);
} finally {
if (tx != null) {
tx.close();
}
}
If you agree, I would request that we follow this logic instead in other
places as well below.
flume-ng-core/src/test/java/org/apache/flume/channel/TestChannelProcessor.java
<https://reviews.apache.org/r/4837/#comment16521>
Missing the license header.
flume-ng-core/src/test/java/org/apache/flume/channel/TestChannelProcessor.java
<https://reviews.apache.org/r/4837/#comment16520>
Thanks for adding these tests.
- Arvind
On 2012-04-22 20:04:13, Brock Noland wrote:
bq.
bq. -----------------------------------------------------------
bq. This is an automatically generated e-mail. To reply, visit:
bq. https://reviews.apache.org/r/4837/
bq. -----------------------------------------------------------
bq.
bq. (Updated 2012-04-22 20:04:13)
bq.
bq.
bq. Review request for Flume.
bq.
bq.
bq. Summary
bq. -------
bq.
bq. ChannelProcessor did not handle transactions well, in some cases if
anything but ChannelException was thrown, the close in the finally would throw
an exception as rollback was not called. In other cases if a subclass of error
was thrown the same would occurred. Additionally, if getTransaction threw an
exception the null transaction value was not handled and an NPE would be thrown.
bq.
bq.
bq. This addresses bug FLUME-1131.
bq. https://issues.apache.org/jira/browse/FLUME-1131
bq.
bq.
bq. Diffs
bq. -----
bq.
bq.
flume-ng-core/src/test/java/org/apache/flume/channel/TestChannelProcessor.java
PRE-CREATION
bq. flume-ng-core/pom.xml b9f1e12
bq.
flume-ng-core/src/main/java/org/apache/flume/channel/ChannelProcessor.java
eb6460e
bq.
bq. Diff: https://reviews.apache.org/r/4837/diff
bq.
bq.
bq. Testing
bq. -------
bq.
bq. Tests added and tests pass.
bq.
bq.
bq. Thanks,
bq.
bq. Brock
bq.
bq.
> ChannelProcessor does not handle transactions appropriately
> -----------------------------------------------------------
>
> Key: FLUME-1131
> URL: https://issues.apache.org/jira/browse/FLUME-1131
> Project: Flume
> Issue Type: Bug
> Affects Versions: v1.1.0
> Reporter: Brock Noland
> Assignee: Brock Noland
> Attachments: FLUME-1131-0.patch
>
>
> If an Exception is thrown in ChannelProcessor.processEvent whilst getting an
> exception, tx will be null and when rollback is called on tx, an NPE will be
> thrown.
> {noformat}
> 12/04/18 19:03:17 ERROR source.PollableSourceRunner: Unhandled exception,
> logging and sleeping for 5000ms
> java.lang.NullPointerException
> at
> org.apache.flume.channel.ChannelProcessor.processEvent(ChannelProcessor.java:183)
> at
> org.apache.flume.source.SequenceGeneratorSource.process(SequenceGeneratorSource.java:48)
> at
> org.apache.flume.source.PollableSourceRunner$PollingRunner.run(PollableSourceRunner.java:131)
> at java.lang.Thread.run(Thread.java:662)
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira