Skip to content

Conversation

@tsnoam
Copy link
Member

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

 - 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 jobqueue: Thread safety fixes - Fixes #968 jobqueue: Thread safety fixes Jan 19, 2018
@Eldinnie
Copy link
Member

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

@tsnoam
Copy link
Member Author

tsnoam commented Jan 20, 2018

@Eldinnie Yes it's possible.

@tsnoam
Copy link
Member Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JobQueue.jobs() is not thread safe

3 participants