Fix exception leaving app in IO block (use non-blocing IO to teardown writer)
This commit is contained in:
parent
07c35cc8bf
commit
a3d2ea37d5
@ -1,5 +1,8 @@
|
|||||||
from threading import Thread
|
from contextlib import suppress
|
||||||
|
from os import O_NONBLOCK, O_RDONLY, close
|
||||||
|
from os import open as osopen
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
|
from threading import Thread
|
||||||
|
|
||||||
from .terminate_process_on_failure import terminate_process_on_failure
|
from .terminate_process_on_failure import terminate_process_on_failure
|
||||||
|
|
||||||
@ -34,4 +37,6 @@ class PipeWriterThread(Thread):
|
|||||||
|
|
||||||
def unblock(self):
|
def unblock(self):
|
||||||
self._write_queue.put(None)
|
self._write_queue.put(None)
|
||||||
open(self._pipe_path, 'rb').close()
|
with suppress(OSError):
|
||||||
|
fd = osopen(self._pipe_path, O_RDONLY | O_NONBLOCK)
|
||||||
|
close(fd)
|
||||||
|
Loading…
Reference in New Issue
Block a user