simon-git: bob (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Feb 29 08:38:07 GMT 2024
TL;DR:
0ca26a5 Fix mishandling of Podman startup errors.
Repository: https://git.tartarus.org/simon/bob.git
On the web: https://git.tartarus.org/?p=simon/bob.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2024-02-29 08:38:07
commit 0ca26a540a03394fecc33277d762dc8322790641
web diff https://git.tartarus.org/?p=simon/bob.git;a=commitdiff;h=0ca26a540a03394fecc33277d762dc8322790641;hp=3749073d9ab4afa7dd579fa641063b7df04f02c5
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Feb 29 08:22:16 2024 +0000
Fix mishandling of Podman startup errors.
My previous workaround for Podman's stdout lockup, using named pipes
shared into the container as the transport for the delegate protocol,
had a bug. If the container completely failed to start up, for example
because the container image name had a mistake, then bob would hang
completely, because it was still trying to open the read end of a
named pipe that nothing was ever going to open the write end of.
Now I open the pipes in both directions myself, preventing the hang.
Then I give the Podman subprocess a copy of the write side of the
output pipe on its own standard output, _as well_ as it reopening them
later for transport. This way we detect failure promptly.
The read side of the input pipe can't be given to the subprocess in
the same way, or else Podman's I/O manager (conmon) fights with us in
trying to read from it. So that one I just close myself once I've had
an ack from inside the container.
As a bonus, I also print the container command's stderr if it fails to
start up. So not only does a build not hang if the container can't be
started, but we also see the error message saying why.
execute.py | 46 ++++++++++++++++++++++++++++++++++------------
misc.py | 12 ++++++++++++
2 files changed, 46 insertions(+), 12 deletions(-)
More information about the tartarus-commits
mailing list