Application-level error handling of non-retryable tasks #3

ghost opened this Issue Feb 6, 2010 · 0 comments


None yet
0 participants

ghost commented Feb 6, 2010

A general scheme for application-level error-handling of non-retryable tasks may be something that
Darkstar should provide as a service. Solving this problem is of general use to developers, as brought up in the following posting:

The issue discussed was a need to handle programmatically a non-retryable failure in the task that
invokes the application's ClientSessionListener?.receivedMessage callback which processes an incoming message from a client. If the application's 'receivedMessage' implementation throws a non-retryable exception (due to a bug, for example), then the exception is logged at the WARNING level, but there is currently no programmatic way for the application to capture that exception and take some action. In the specific case of 'receivedMessage' throwing a non-retryable exception, the customer wants to send a message to the client to inform the user that the action associated with the message was not performed and that the user needs to try something else. Alternatively, without an explicit message to the client, the client would have to wait for some period of time and assume that the action didn't happen. This produces an unfortunate lag-time in response to the user.

The solution suggested to the customer was to write a custom "error service" for handling this
situation. The service could be used by the task to forward the error to the client if necessary. Since the "error service" is a service, it can interact with other services, and schedule tasks (transactional or non-transactional) to execute independent of the outcome of the calling task.

Application-level error-handling is likely something that many customers will want. While it is possible for customers to write their own "error service" to use, it might be better for Darkstar to provide a single, cohesive model for handling non-retryable exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment