Page MenuHomeSoftware Heritage

Make next_visit_queue_position an integer
ClosedPublic

Authored by olasd on Dec 7 2021, 5:43 PM.

Details

Summary

In visit types with small amounts of origins having no last_update
field, we would end up overflowing Python datetimes (which only go up to
31 December 9999) pretty quickly. Making the queue position a 64-bit
integer should give us some more leeway.

The queue position now defaults to zero instead of an arbitrary point in
time. Queue offsets are still commensurate with seconds, but that's
mostly to give them some space to be splayed by the fudge factors.

Related to T3748
Sentry report https://sentry.softwareheritage.org/share/issue/fa61b8333b0c4c429f8cf1356e3fc08d/

Test Plan
  • unit tests updated with the new dimension for the queue position
  • tested the migration script locally

Diff Detail

Repository
rDSCH Scheduling utilities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6777 (id=24597)

Rebasing onto 0a6aac583a...

Current branch diff-target is up to date.
Changes applied before test
commit 5de8ba42c29b569293700010fc36d46a7ca157a8
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Dec 7 13:57:51 2021 +0100

    Make next_visit_queue_position an integer
    
    In visit types with small amounts of origins having no last_update
    field, we would end up overflowing Python datetimes (which only go up to
    31 December 9999) pretty quickly. Making the queue position a 64-bit
    integer should give us some more leeway.
    
    The queue position now defaults to zero instead of an arbitrary point in
    time. Queue offsets are still commensurate with seconds, but that's
    mostly to give them some space to be splayed by the fudge factors.

See https://jenkins.softwareheritage.org/job/DSCH/job/tests-on-diff/500/ for more details.

olasd requested review of this revision.Dec 7 2021, 5:46 PM
This revision is now accepted and ready to land.Dec 7 2021, 5:53 PM
This revision was automatically updated to reflect the committed changes.