cds-snc / covid-alert-server

Exposure Notification: Diagnosis Server implementation / Notification d’exposition : Mise en œuvre du serveur de diagnostic
Apache License 2.0
298 stars 31 forks source link

OTKExpired being counted multiple times in certain circumstances #419

Closed CalvinRodo closed 3 years ago

CalvinRodo commented 3 years ago

We have an issue where expired OTKs are being counted multiple times when one of the workers attempts to delete Expired OTKs at midnight.

Due to each service running a worker we run into a race condition where each worker is attempting to count and then delete the expired keys.

Because the algorithm is as follows