[
https://issues.apache.org/jira/browse/FLUME-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497694#comment-13497694
]
Mike Percy commented on FLUME-1707:
-----------------------------------
Hi Will, this content is really great! I do have a couple of suggestions:
1. Please leave out the changes to the title, since that won't backport
cleanly. i.e. the lines around Flume 1.3.0 Developer Guide which just extend
the ==== things which doesn't appear to be required. Also, please base the
patch off of trunk.
2. For the code examples where we are using Transactions, the idiom should
actually be:
{noformat}
Transaction txn = channel.getTransaction();
txn.begin();
try {
// whatever channel operations you want to do
txn.commit();
} catch (Throwable t) { // <-- note we are actually catching Throwable
txn.rollback();
// log exception, handle individual exceptions as needed
// rethrow all Errors
if (t instanceof Error) {
throw (Error) t;
}
} finally {
txn.close();
}
{noformat}
This is because txn.close() will throw an exception if we don't call rollback,
which will hide the true causal exception. This could happen if there was an
OutOfMemoryError thrown, for example, but we will never see the OOME error in
the log because close() will cover it up with its own InvalidStateException.
> Update FlumeDevGuide
> --------------------
>
> Key: FLUME-1707
> URL: https://issues.apache.org/jira/browse/FLUME-1707
> Project: Flume
> Issue Type: Bug
> Components: Docs
> Affects Versions: v1.3.0
> Reporter: Will McQueen
> Assignee: Will McQueen
> Priority: Blocker
> Fix For: v1.3.0
>
> Attachments: FLUME-1707v1.patch
>
>
> There are several places in FlumeDeveloperGuide that have missing or
> incorrect info. These need to be updated.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira