Use DB time for background job time limit#5560
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5560 +/- ##
==========================================
+ Coverage 77.28% 77.32% +0.04%
==========================================
Files 995 996 +1
Lines 36467 36431 -36
Branches 5520 5518 -2
==========================================
- Hits 28184 28172 -12
+ Misses 6924 6904 -20
+ Partials 1359 1355 -4 🚀 New features to boost your workflow:
|
rbans96
left a comment
There was a problem hiding this comment.
Nice fix ? using DB time eliminates the clock skew issue cleanly. The Task.Delay removals in E2E tests confirm it works. A couple things to consider:
|
Potential Bug: Inconsistent DateTime → DateTimeOffset conversion In BulkUpdateOrchestratorJob.cs around line 178: But in CreateProcessingDefinition (same file, line ~279): JobInfo.CreateDate is DateTime (not DateTimeOffset). The first form relies on C#'s implicit conversion, which uses the local timezone offset when DateTime.Kind == Unspecified. The second form explicitly sets UTC offset. If the DB returns Kind == Unspecified, these two paths will produce different timestamps on non-UTC servers. Suggest using |
Description
Some background jobs have a clause to prevent them working on data created after they were queued. This PR changes the source of the time to be the DB set create time instead of it being set by the server when the job is queued. This prevents mismatches between the two sources that could lead to resources being missed if they were created very soon before a job was enqueued.
Related issues
Addresses Bug 191061
Testing
Existing E2E tests
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)