ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Possible bug with job queue retries

Open CarlOhlsson opened this issue 4 years ago • 1 comments

Hi!

We noticed something odd with the standard job queue retry procedure. When you set a job queue with max amount of retries we expect the retry counter to be set to 0 if the job runs successfully after x amount for failures but its does not. The retry counter is only set to 0 when a user sets the job queue entry to ready again.

To test this this you can create a job queue with the following code. Set up a job queue with 15 max retries and set it to run every minute. `

trigger OnRun()
begin
    if Rec."No. of Attempts to Run" < 5 then begin
        Error('Random error message for run %1', Rec."No. of Attempts to Run");
    end;

    if Rec."No. of Attempts to Run" = 5 then begin
        // Successful
    end;
end;

`

It will fail 5 times and after that run successfully forever. If you look at the job queue entry after the 6th (successful) run you will see that field still contains "No. of Attempts to Run" is still 5.

So in a scenario where the job fails again it will not have 15 retries, it will only do 10 before the job queue gets status "Error".

Is this as designed or a bug?

CarlOhlsson avatar Sep 29 '22 11:09 CarlOhlsson

Hi! Please take a minute to read the guidelines for this repository https://github.com/microsoft/AL and our collection of frequently asked questions https://github.com/Microsoft/AL/wiki/frequently-Asked-Questions . This repository is only for extensibility requests for Dynamics 365 Business Central. We suggest that you open a support case or file a bug to ensure that all Business Central users benefit from your catch as soon as possible: • On premises - https://support.microsoft.com/en-us/supportforbusiness/productselection?sapId=93d37907-ad94-d591-22e9-593cfa09dd3f • On line – contact your partner, or if you are a partner open a support incident through Partner Center - https://partner.microsoft.com/en-us/pcv/dashboard/overview

AlexanderYakunin avatar Oct 12 '22 17:10 AlexanderYakunin