DWR

Handling server down/errors with reverse ajax

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Normal Normal
  • Resolution: Fixed
  • Affects Version/s: 3.0.RC1
  • Fix Version/s: 3.0.RC3
  • Component/s: Engine, Reverse Ajax
  • Documentation Required:
    Yes
  • Description:
    Hide
    If the server is down with reverse ajax enabled and pollRetries is > maxPollRetries we don't call an error handler.

    dwr.engine._pollErrorHandler = function(msg, ex) {
        if (dwr.engine._pollRetries > dwr.engine._maxPollRetries) {
          dwr.engine._activeReverseAjax = false;
          dwr.engine._debug("Reverse Ajax poll failed (retries=" + dwr.engine._pollRetries + "). Giving Up: " + ex.name + " : " + ex.message);
          dwr.engine._debug("Giving up.");
          return;
        }
    Show
    If the server is down with reverse ajax enabled and pollRetries is > maxPollRetries we don't call an error handler. dwr.engine._pollErrorHandler = function(msg, ex) {     if (dwr.engine._pollRetries > dwr.engine._maxPollRetries) {       dwr.engine._activeReverseAjax = false;       dwr.engine._debug("Reverse Ajax poll failed (retries=" + dwr.engine._pollRetries + "). Giving Up: " + ex.name + " : " + ex.message);       dwr.engine._debug("Giving up.");       return;     }

Activity

Hide
David Marginian added a comment - 07/Apr/09 8:21 AM

What is the best way to handle this? The retry logic is quite extensive:
Interval: [ 2, 5, 10, 60, 300 ]

There are 11 retries and after the first 4 the wait time between each retry is 300 seconds. Even if we were to add an errorHandler call to pollErrorHandler it would not be executed for a long time.

Show
David Marginian added a comment - 07/Apr/09 8:21 AM What is the best way to handle this? The retry logic is quite extensive: Interval: [ 2, 5, 10, 60, 300 ] There are 11 retries and after the first 4 the wait time between each retry is 300 seconds. Even if we were to add an errorHandler call to pollErrorHandler it would not be executed for a long time.
Hide
Mike Wilson added a comment - 07/Aug/10 4:24 PM

I think we should call an error handler right away, and then continue retrying forever. We might want to use a separate error/status handler.
If someone wants to stop retrying after a while, then it should be possible to just call setActiveReverseAjax(false).

Show
Mike Wilson added a comment - 07/Aug/10 4:24 PM I think we should call an error handler right away, and then continue retrying forever. We might want to use a separate error/status handler. If someone wants to stop retrying after a while, then it should be possible to just call setActiveReverseAjax(false).
Hide
David Marginian added a comment - 24/Aug/10 5:14 AM

I need to update the docs to reflect the recent changes.

Show
David Marginian added a comment - 24/Aug/10 5:14 AM I need to update the docs to reflect the recent changes.
Hide
David Marginian added a comment - 13/Jul/11 4:24 AM

Re-opening this for a minor change.

Show
David Marginian added a comment - 13/Jul/11 4:24 AM Re-opening this for a minor change.
Hide
David Marginian added a comment - 29/Jul/11 3:51 PM

The following changes have been made:

1) The error handler is not called immediately on failure.
2) After a configurable number of retries the pollStatusHandler will be called bring dwr offline.
3) If a pollStatusHandler has not been defined the default pollStatusHandler will be used which delegates to the errorHandler.

Show
David Marginian added a comment - 29/Jul/11 3:51 PM The following changes have been made: 1) The error handler is not called immediately on failure. 2) After a configurable number of retries the pollStatusHandler will be called bring dwr offline. 3) If a pollStatusHandler has not been defined the default pollStatusHandler will be used which delegates to the errorHandler.

People

Dates

  • Created:
    07/Apr/09 5:21 AM
    Updated:
    23/Nov/12 6:45 AM
    Resolved:
    23/Nov/12 6:45 AM