metatype icon indicating copy to clipboard operation
metatype copied to clipboard

fix(subs): key collision on redis

Open michael-0acf4 opened this issue 1 year ago • 0 comments
trafficstars

Follow up of #863 When multiple start occurs for redis, some schedules can happen exactly at the same time resulting into the same identifier (and leading to an inconsistent state).

This solution simply combines the schedule with the run_id making it unique instead of using it as is.

mutation AllAtOnce {
  a: start_retry(kwargs: { .. }) # => calls add_schedule( ... date ...)
  b: start_retry(kwargs: { .. })
  c: start_retry(kwargs: { .. })
  d: start_retry(kwargs: { .. }) 
  e: start_retry(kwargs: { .. })
  f: start_retry(kwargs: { .. })
 # ..
}

Migration notes

None

  • [ ] The change comes with new or modified tests
  • [ ] Hard-to-understand functions have explanatory comments
  • [ ] End-user documentation is updated to reflect the change

michael-0acf4 avatar Oct 03 '24 14:10 michael-0acf4