Silence "Exception ignored when trying to write to the signal wakeup fd"

Disable warn_on_full_buffer via set_wakeup_fd. This avoids tons of

    Exception ignored when trying to write to the signal wakeup fd:
    BlockingIOError: [Errno 11] Resource temporarily unavailable

that are currently issued after running complex builds. Only works since
Python 3.7, though, so this remains best-effort. Fortunately, the Debian
in our container image is 3.7.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2020-12-02 10:30:22 +01:00
parent 368cdffc24
commit 87af46ff8c

View File

@ -31,6 +31,7 @@ import tempfile
import asyncio
import errno
import pathlib
import signal
from subprocess import Popen, PIPE
from .context import get_context
@ -93,6 +94,13 @@ async def run_cmd_async(cmd, cwd, env=None, fail=True, liveupdate=True):
logo = LogOutput(liveupdate)
try:
orig_fd = signal.set_wakeup_fd(-1, warn_on_full_buffer=False)
signal.set_wakeup_fd(orig_fd, warn_on_full_buffer=False)
except TypeError:
# Python < 3.7 - we tried our best
pass
try:
process = await asyncio.create_subprocess_exec(
*cmd,