[ 
https://issues.apache.org/jira/browse/FLUME-1321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13634565#comment-13634565
 ] 

Mike Percy commented on FLUME-1321:
-----------------------------------

My take on the summary from the RB discussion are as follows:

Goal from this change: Make the client semantics for channel simpler (don't 
require people to catch Throwable).
Desired idiom:

{noformat}
txn.begin()
try {
  // do stuff, puts, whatever
  ch.put(...);
  ch.commit();
} catch (FlumeException ex) {
  ch.rollback();
} finally {
  txn.close();
}
{noformat}

Action items:
1. Document this desired behavior in Channel interface
2. Fix affected channels (FC is one) such that a close() always does a rollback 
on an open transaction, but will never throw (only log)

#2 could be broken into subtasks of this JIRA
                
> BasicTransactionSemantics should never throw from close()
> ---------------------------------------------------------
>
>                 Key: FLUME-1321
>                 URL: https://issues.apache.org/jira/browse/FLUME-1321
>             Project: Flume
>          Issue Type: Bug
>    Affects Versions: v1.1.0
>            Reporter: Mike Percy
>             Fix For: v1.4.0
>
>         Attachments: FLUME-1321.2.patch, FLUME-1321.patch
>
>
> Currently, BasicTransactionSemantics can throw from close(). This means that 
> exceptions will be clobbered in cases where unexpected exceptions are thrown, 
> since close() is idiomatically called in a finally block.

--
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

Reply via email to