9
0
Fork 0

Fix another file handle seeking cornercase
continuous-integration/drone Build is passing Details

This commit is contained in:
Lauri Võsandi 2022-11-07 16:45:10 +02:00
parent 3cf2ea9e28
commit 1e3f16ca02
1 changed files with 4 additions and 2 deletions

View File

@ -258,7 +258,6 @@ class LogFile(object):
self.loop.create_task(self.handler_loop())
def poke(self):
self.tail = self.fh.seek(0, os.SEEK_END)
self.more_content.set()
def close(self):
@ -291,9 +290,12 @@ class LogFile(object):
break
await self.more_content.wait()
self.more_content.clear()
self.tail = self.fh.seek(0, os.SEEK_END)
assert self.head < self.tail
self.fh.seek(self.head)
buf = self.fh.readline()
self.head += len(buf)
try:
reason = "unicode-encoding"
@ -314,7 +316,7 @@ class LogFile(object):
break
histogram_line_size.observe(len(buf))
self.head += len(buf)
record_size += len(buf)
if record_size < args.max_record_size: