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

jobqueue: Thread safety fixes #977

Merged
merged 1 commit into from Jan 20, 2018

Conversation

Projects
None yet
2 participants
@tsnoam
Member

tsnoam commented Jan 19, 2018

  • Fix JobQueue.jobs to obtain a lock on the internal queue object prior
    to iterating over it.

  • Rename JobQueue.queue to JobQueue._queue. This shouldn't be
    accessible by the user directly, but rather only with sanitized
    thread safe methods.

  • JobQueue.interval_seconds - access self.interval only once to avoid
    race conditions.

Fixes #968

jobqueue: Thread safety fixes
 - Fix JobQueue.jobs to obtain a lock on the internal queue object prior
   to iterating over it.

 - Rename JobQueue.queue to JobQueue._queue. This shouldn't be
   accessible by the user directly, but rather only with sanitized
   thread safe methods.

 - JobQueue.interval_seconds - access self.interval only once to avoid
   race conditions.

@tsnoam tsnoam changed the title from jobqueue: Thread safety fixes - Fixes #968 to jobqueue: Thread safety fixes Jan 19, 2018

@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Jan 20, 2018

Member

Looks good. But why not directly integrate #934 in this?

Member

Eldinnie commented Jan 20, 2018

Looks good. But why not directly integrate #934 in this?

@tsnoam

This comment has been minimized.

Show comment
Hide comment
@tsnoam

tsnoam Jan 20, 2018

Member

@Eldinnie Yes it's possible.

Member

tsnoam commented Jan 20, 2018

@Eldinnie Yes it's possible.

@tsnoam

This comment has been minimized.

Show comment
Hide comment
@tsnoam

tsnoam Jan 20, 2018

Member

@Eldinnie Actually #934 is not complete. Still missing unitests.
I'll merge tihs PR and we'll wait for the author of #934 to add unitests.

Member

tsnoam commented Jan 20, 2018

@Eldinnie Actually #934 is not complete. Still missing unitests.
I'll merge tihs PR and we'll wait for the author of #934 to add unitests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment