[SERVER-75036] Avoid duration overflow inside PeriodicRunner thread Created: 20/Mar/23  Updated: 27/Oct/23  Resolved: 28/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Backlog - Service Architecture
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Service Arch
Operating System: ALL
Participants:

 Description   

It's not clear whether PeriodicRunner expects its jobs to not throw exceptions. But aside from that, the actual PeriodicRunnerImpl can throw exceptions, which crashes the server in some unit tests.

If a unit test advances the system clock far ahead of time, this calculation can overflow



 Comments   
Comment by Louis Williams [ 27/Mar/23 ]

This will be a problem for any PeriodicJob that also runs during certain unit tests which artificially advance the clock near the max value, like this test.

I ended up not needing this because the component I was building no longer needed a PeriodicJob. Not running the job is also a workaround, but it may not be in all cases.

Generated at Thu Feb 08 06:29:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.