commit 43c1141baa6c5a5987fd4ab71d1c2299898ea251
Author: Alistair Coles <email address hidden>
Date: Thu Oct 9 09:42:16 2014 +0100
Fix race in shell when testing for errors to raise SysExit
SysExit is raised if the OutputManager has non-zero
error_count. However, error_count is incremented in
a print thread, but tested on the main thread.
Currently error_count is tested before the OutputManager
print threads have exited, which results in a race. This race
means that SysExit is not always raised even when an error
has occured.
This change moves the error_count test after the
OutputManager context manager has exited, which ensures that
the OutputManager threads have exited.
Reviewed: https:/ /review. openstack. org/127196 /git.openstack. org/cgit/ openstack/ python- swiftclient/ commit/ ?id=43c1141baa6 c5a5987fd4ab71d 1c2299898ea251
Committed: https:/
Submitter: Jenkins
Branch: master
commit 43c1141baa6c5a5 987fd4ab71d1c22 99898ea251
Author: Alistair Coles <email address hidden>
Date: Thu Oct 9 09:42:16 2014 +0100
Fix race in shell when testing for errors to raise SysExit
SysExit is raised if the OutputManager has non-zero
error_count. However, error_count is incremented in
a print thread, but tested on the main thread.
Currently error_count is tested before the OutputManager
print threads have exited, which results in a race. This race
means that SysExit is not always raised even when an error
has occured.
This change moves the error_count test after the
OutputManager context manager has exited, which ensures that
the OutputManager threads have exited.
Change-Id: I5ef7d9f10057fe 2b41f48ab95066a 7265b86a3ac
Closes-Bug: #1379229