resque-job-stats icon indicating copy to clipboard operation
resque-job-stats copied to clipboard

Atomicity issue when incrementing and setting expiration

Open bilby91 opened this issue 5 years ago • 1 comments

Hello,

We had a couple of issues recently where some time series values got an empty string without expiration.

Shouldn't the code in https://github.com/alanpeabody/resque-job-stats/blob/v0.4.2/lib/resque/plugins/job_stats/timeseries.rb#L50 be wrapped with a MULTI command ?

We can get a PR going if their is willingness to merge it.

Thanks!

bilby91 avatar Nov 04 '19 16:11 bilby91

@bilby91 sounds reasonable to me - if you want to do a PR, a couple requests

  • looks like actually it's incr_timeseries that should use the transaction, to keep minutes stats in sync with hours stats
  • there are other places in the codebase that are subject to the same problem, e.g. push_history in history.rb - if you tackled these as well that would be 💯

lukeasrodgers avatar Nov 05 '19 14:11 lukeasrodgers