Adds docs about using ProgressBar with threads #2871
Conversation
@dkliban, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bmbouter, @goosemania and @seandst to be potential reviewers. |
Add test.py[0] to your pulp/app/pulp/app directory and start the django shell. Then run import test |
I removed [WIP] from the title since we us the Label now for that |
@dkliban I did use the reproducer and I did reproduce the issue. I experimented with several other options and read some documentation. I've come to the conclusion that what is really important is that all threads use the same instance of ProgressBar and then we don't have to worry about thread race conditions inside of the instance methods. I can write more on this tomorrow and we can discuss it some too with @mhrivnak who originally raised the thread safety concern. We likely will add some doc lines to the docstring, but I don' think a code change is necessary here. |
428802d
to
30ad9e2
Compare
30ad9e2
to
d281930
Compare
What about this?
|
d281930
to
eb2cd45
Compare
|
||
When using threads to update a ProgressBar in parallel, it is recommended all threads share the | ||
same in-memory instance. Django does not synchronize in-memory model instances, so multiple | ||
instances of a specific ProgressBar will diverge as they are written to in separate threads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/in/from/
eb2cd45
to
7599ef6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Thanks @dkliban !
7599ef6
to
ee3ec28
Compare
No description provided.