2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-17 21:23:18 +00:00

Merge branch 'master' into multiplex

This commit is contained in:
Jarrod Johnson 2016-03-25 16:47:23 -04:00
commit 44a5c2b464

View File

@ -625,6 +625,8 @@ class Logger(object):
binfile = open(binpath, mode='r')
textfile = open(textpath, mode='r')
except IOError:
binfile = None
textfile = None
break
flock(binfile, LOCK_SH)
flock(textfile, LOCK_SH)
@ -649,11 +651,15 @@ class Logger(object):
textdata = ''
while offsets:
(offset, length, textpath) = offsets.pop()
if textfile is None:
textfile = open(textpath, mode='r')
flock(textfile, LOCK_SH)
if textfile.name != textpath:
try:
flock(textfile, LOCK_UN)
textfile.close()
textfile = open(textpath, mode='r')
flock(textfile, LOCK_SH)
except (ValueError, IOError) as e:
break
try: