Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atomicity issue when incrementing and setting expiration #37

Open
bilby91 opened this issue Nov 4, 2019 · 1 comment
Open

Atomicity issue when incrementing and setting expiration #37

bilby91 opened this issue Nov 4, 2019 · 1 comment

Comments

@bilby91
Copy link

bilby91 commented Nov 4, 2019

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 bilby91 changed the title Potential race condition when incrementing and setting expiration Atomicity issue when incrementing and setting expiration Nov 4, 2019
@lukeasrodgers
Copy link
Collaborator

@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 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants