The original bug report introduces a greenthread.sleep() to reproduce the problem, but since the logging calls involve I/O, I still think there's a potential problem if we're debug logging.
There's no unit test for this code - I'll add one, and see what that finds. Another test wont hurt.
Also, is there any good reason to delete the semaphores anyway ? We have less than a dozen in the code, and they're not very expensive in terms of resources.
The original bug report introduces a greenthread.sleep() to reproduce the problem, but since the logging calls involve I/O, I still think there's a potential problem if we're debug logging.
There's no unit test for this code - I'll add one, and see what that finds. Another test wont hurt.
Also, is there any good reason to delete the semaphores anyway ? We have less than a dozen in the code, and they're not very expensive in terms of resources.