Issue Details (XML | Word | Printable)

Key: MULE-3740
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Travis Carlson
Reporter: Daniel Feist
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Mule

New retry policy implementation wraps send/dispatch exceptions and reports them as FatalConnectException's

Created: 30/Sep/08 09:50 AM   Updated: 03/Oct/08 05:21 PM
Component/s: Core: Transports
Affects Version/s: 2.1-M2
Fix Version/s: 2.0 ITR7, 2.1.0

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: Not Specified
Time Spent - 1 day, 1 hour, 30 minutes
Time Spent: 1 day, 1 hour, 30 minutes
Time Spent - 1 day, 1 hour, 30 minutes

Issue Links:
Related
 

Labels:
User impact: Low


 Description  « Hide
Some notes from discussion with Travis:
  • Should send()/dispatch() really be executed as part of the Retry work job along with connect()?
  • What stops retry policy executing numerous times when the exception is simple a transformer issue (TransformerException)?
  • If retry fails because of a transformer exception for example how to we avoid throwing a somewhat confusing FatalConnectException?
  • If we no long wrap exceptions in FatalConnectException in AsbtractRetryTemplate and just throw the cause then we we wouldn't be differentiating between simple connect exceptions and fatal exceptions caused when retry policies are exhausted which doesn't sound ideal.
  • AbstractRetryTemplate is supposed to be generic so shouldn't be throwing a FatalConnectException but rather a RetryStrategyExhaustedException. This could then be wrapped in ConnectException by the callee.

It looks like either send()/dispatch() shouldn't be inside retry callback, or if they are there by design then we need a way in which to determine which exception types should result in the retry policy being executed and which exception types should not, rather causing retry loop to end and throwing the exception up (e.g. TransformerException)

Update (Dan F)
I've taken a closer look at the code and I really can't see why we have retry callbacks being used in for example AsbtractMessageDispatcher send()/dispatch() for reconnection. The connect() already uses a retry callback/work item to connect, so by implementing another one here we actually giving send/dispatch/receive retry functionality. I assume this is by design even though it's more just an improvement implementation of reconnection strategies. If this is the case we need to make this change clear in documentation so users know that the retry policy they configure is used for connect, dispatch, send and receive and any implications of this. Also I still think we need to think a bit more about what types of exceptions should/shouldn't result in retry in all of these cases.



 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Daniel Feist added a comment - 01/Oct/08 08:45 AM
Talked this through with Ross and Travis:
  • Retry should only be used for connect(), not dispatch(), send() or request()
  • We should continue to throw an exception from RetryPolicyTemplate when policy(retry) is exhausted, but preferably this should be a generic RetryPolicyExhaustedException rather than a FatalConnectException

Travis Carlson added a comment - 01/Oct/08 03:56 PM
Looking at, e.g., the JDBC transport, I notice that the doConnect() methods are all empty, the actual connection occurs inside doDispatch(), so having retry on the connect() method only will do nothing for JDBC

Did reconnection ever actually work for the JDBC transport, I wonder?


Ross Mason added a comment - 01/Oct/08 05:16 PM
can you refactor the JDBC code to use the proper connect method?

Typically folks were using reconnect strategies for messaging


Travis Carlson added a comment - 02/Oct/08 09:42 AM
OK, I've refactored this for the JDBC transport and now it works like a charm, so it looks like this is the way to go. Created MULE-3754 for this (separate) task.

Travis Carlson added a comment - 02/Oct/08 04:17 PM
r12855