Skip to content

Commit 8d5f905

Browse files
committed
fix queue.FULL exception when writer thread write data slowly.
1 parent 722182b commit 8d5f905

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

python/pyarrow/io.pxi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ cdef class NativeFile:
312312
pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,
313313
bytes_read)
314314

315+
if writer_thread.is_alive():
316+
while write_queue.full():
317+
time.sleep(0.01)
318+
else:
319+
break
320+
315321
write_queue.put_nowait(pybuf)
316322
finally:
317323
free(buf)

0 commit comments

Comments
 (0)