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

fix calling cleanup function in Worker.run() to avoid race condition #1455

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions minio/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,9 @@ def run(self):
self._results_queue.put(result)
except Exception as ex: # pylint: disable=broad-except
self._exceptions_queue.put(ex)
finally:
cleanup_func()

# call cleanup i.e. Semaphore.release irrespective of task execution to avoid race condition.
balamurugana marked this conversation as resolved.
Show resolved Hide resolved
cleanup_func()
detailyang marked this conversation as resolved.
Show resolved Hide resolved
# Mark this task as done, whether an exception happened or not
self._tasks_queue.task_done()

Expand Down
Loading