Task Agent and StartUp Schedule

Behaviour observed in 10.2.600 and 10.2.700. When you have a Scheduled Item set for Startup if you restart your Task Agent, it won’t fire. If you stop and start your Task Agent within 1 minute, the same it won’t fire. You have to either way 1+ minutes before you start it again, or you blank out the NextRunOnDate… oddly enough Epicor sets it and sets it back to null after a successful 1+ min wait and Start of TA Service.

@JeffLeBert is this a built in timer that is meant to help truly identify restart vs startup? Basically Startup Schedules only fire if there is a 60 second wait between the Stop/Start.

I’ve had internal people ask me this question. We’ve even written it up as a something to do in our work tracking software. This has always been a low priority since it kind of makes sense to work that way. I’ve never gotten time to investigate it.

My guess is that it comes from the code we added to allow multiple Task Agent Services to run. You don’t want Service B picking up the tasks that Service A is already processing. That’s a total guess though.

If you ever see it do this but the time delay is 2+ minutes, then I would raise the priority of the investigation.

@JeffLeBert I wasn’t much upset over the 1 minute, now that I know :slight_smile: figured out I communicate my observation for those that have “fast servers” :slight_smile:

Here is what happened:

  1. Restart TA
  2. Why isn’t Multi-Company Starting Up Again?
  3. Repeat 1-2, 5 times.
  4. Stop TA (not a restart, but a stop)
  5. Start TA
  6. Why isn’t Multi-Company Starting Up Still?!
  7. Blank out the Next Run Date
  8. Refresh System Agent Entry, Epicor put in a Next Run again.
  9. Enable/Disable Schedule, Still Nothing… Rebuild entire Multi-Company Schedule and spend 30min troubleshooting and checking my data
  10. Stop TA
  11. Blank out Next Run Date
  12. Start TA - ok it started Multi-Company a StartUp task this time!
  13. Stop TA
  14. Start TA
  15. Repeat 13-14 a few times.
  16. Stop TA
  17. Wait about 1-2min
  18. Start TA - It Started fine and Epicor blanked out the NextRun for StartUp yay again!

I was looking in the docs to find a “please wait 60 seconds after you stop TA, before you start it again” :slight_smile: I can replicate it everytime. Stopping takes 15 seconds, Starting takes 15 seconds, hence the problem… it works too fast for its own good :stuck_out_tongue:

It may be something as simple as an if/else in ScheduledTaskRunner.cs

I doubt its in this method, since this one seems to be only called when Schedule type is “Immed”


Hope the information helps anyone and your team :slight_smile:

Current Working Options:

  1. Stop TA, Blank Out NextRun, Disable/Enable Schedule, Start TA
  2. Stop TA, Wait 1-2min, Start TA

I’ve added this information to the existing Jira story for this issue. I have no idea when we will get back to working in this area.

1 Like