core: fix race in PidfulStreamHandler

Need to re-test with the lock held, else >1 threads can end up waiting
for lock then reopening the log repeatedly.
wip-fakessh-exit-status
David Wilson 7 years ago
parent a06c92d285
commit df488237d4

@ -219,6 +219,8 @@ class PidfulStreamHandler(logging.StreamHandler):
def _reopen(self):
self.acquire()
try:
if self.open_pid == os.getpid():
return
ts = time.strftime('%Y%m%d_%H%M%S')
path = self.template % (os.getpid(), ts)
self.stream = open(path, 'w', 1)

Loading…
Cancel
Save