Bug #11435

PluginException with LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE does not increase RetryCount

Added by flubshi over 5 years ago. Updated over 5 years ago.

Status:NewStart date:02/27/2014
Priority:HighDue date:03/31/2014
Assignee:jiaz% Done:

0%

Category:Controlling
Target version:-
Resolution:

Description

For a lot of (multi) hosts we throw a PluginException on specific errors and count the retries, to cause a differentiated error handling. For instance: try 3times the same link, but if it fails again: block host over this multi host.

Example code that won't work anymore:

                /*
                 * after x retries we disable this host and retry with normal plugin
                 */
                if (link.getLinkStatus().getRetryCount() >= 3) {
                    /* reset retrycounter */
                    link.getLinkStatus().setRetryCount(0);
                    tempUnavailableHoster(acc, link, 15 * 60 * 1000l, "Some errormsg"); //block host
                }
                String msg = "We try it again (" + (link.getLinkStatus().getRetryCount() + 1) + "/" + 3 + ")";
                throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, msg, 20 * 1000l);

Because throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, msg, 20 * 1000l); doesn't increase link.getLinkStatus().getRetryCount() this error handling is completely broken.

As a consequence it says always "We try it again (1/3)" and an infinite loop occurs.

Please fix it!


Related issues

Related to Bug #11059: [DEV]Exception with LinkStatus.ERROR_TEMPORARILY_UNAVAILA... New 01/18/2014

Also available in: Atom PDF