Avoid ValueError exception from a reporting thread on shutdown
Review Request #3278 - Created Dec. 21, 2015 and submitted
Fixes a problem seen in Ubuntu 14.0.4 under python 2.7.6 frequently when invoking pants:./pants -V 0.0.65 Exception in thread output-emitter (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner File "/home/zundel/.cache/pants/setup/bootstrap/pants.Ob3x3U/install/local/lib/python2.7/site-packages/pants/reporting/report.py", line 23, in run File "/usr/lib/python2.7/threading.py", line 620, in wait File "/usr/lib/python2.7/threading.py", line 363, in wait <type 'exceptions.ValueError'>: list.remove(x): x not in list
This message was harmless, but annoying, probably due to some bug in the threading library.
CI passed at https://travis-ci.org/pantsbuild/pants/builds/98110978
iirc, this was recently changed from a similar time.sleep() loop to Event.wait() for perf reasons - i.e. to save a potential .5 sec sleep on teardown in the simple
more context on the original review: https://rbcommons.com/s/twitter/r/3057/
could we find a way to avoid both this error and the explicit .5 sec sleep?