NAV2017 - TaskScheduler runs task multiple times OR tasks stopped

xStepaxStepa Member Posts: 106
Hi, we have observed strange behaviour of the TaskScheduler on NAV2017 NSTs:
  • By default - periodical tasks are not rescheduling and stay in InProcess status without executing the code - probably it happens when the Task Group is set to some value.
  • Hotfixed - when remove the test HasScheduledTask, it works, but the tasks are run on each NST (e.g. every 10 minutes are processed 10 times) after service restart ...

aporxd60isva.png


Thx
Regards
xStepa

Comments

  • JuhlJuhl Member Posts: 724
    Try having only 1 nst where TS is activated.
    Follow me on my blog juhl.blog
  • xStepaxStepa Member Posts: 106
    yes, that's the actual workaround ... but I want to spread workload.
    Regards
    xStepa
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    You have removed code checking if a task for a given RECORDID is already scheduled so no wonder that tasks are executed multiple times on different NSTs.

    Perhaps the original problem was not with scheduling code, but somewhere else. Maybe scheduled code did not exit cleanly, maybe you should add CANCELTASK at the end of the scheduled object to make sure that scheduler session does not hang around, etc.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • RemkoDRemkoD Member Posts: 100
    xStepa wrote: »
    By default - periodical tasks are not rescheduling and stay in InProcess status without executing the code - probably it happens when the Task Group is set to some value.

    On which Cumulative Update are you running NAV 2017?

    We have trouble with tasks stuck on status 'InProcess' without any session active for the task too. I hope this issue is resolved in NAV 2017 CU15 (platform fix).
    251614 Task scheduler causes deadlocks in a multiple service scenario that causes phantom running job queue entries.

    It would make sense that the current work-around suggested by Juhl works.
    Juhl wrote: »
    Try having only 1 nst where TS is activated.

    I would expect that the issue is resolved when you're using CU 15 or higher. I'm really curious if this is true.
  • xStepaxStepa Member Posts: 106
    Hi, thanks for suggestions - we are running CU15 from the beginning ...
    Regards
    xStepa
  • RemkoDRemkoD Member Posts: 100
    Okay, that's a shame.. I actually hoped that the problem would be resolved in that fix.

    In NAV2017 CU 16 (application) there is a change for the task scheduler too. Might be worth a try to port back this fix in your application if you haven't already.
    262725 Task scheduler causes a heavy locking and deadlocks in the application that makes it impossible to port job queue scheduling from Dynamics NAV 2016. Administration COD 448 TAB 472
  • xStepaxStepa Member Posts: 106
    yes, will try to move to CU18 in the next few days ...
    Regards
    xStepa
Sign In or Register to comment.