pdnsutil zone list: give up if output stalls #16645
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short description
We have had reports, when
pdnsutilruns in a container, that pipeing the output ofpdnsutil(running in the container) to a local process (not running in the container) can sometimes end up withpdnsutilstuck in a blocking call to write to the pipe, although the pipe reader on the local machine is long gone.Of course the container is to blame for not implementing proper pipe semantics, but it look like it's
pdnsutil's fault, so we have to do something.This PR, when
pdnsutil zone listis not a tty, will:This is a currently a draft PR, as I would like some feedback, especially on the following points:
Note that, in the current state of this PR, if you
pdnsutil zone list what.ever|lessand idle inless,pdnsutilwill abort after 30 seconds and you will only get an incomplete listing.I have considered switching back to blocking i/o and write an error, but in the "
pdnsutilrunning in a container" case mentioned above, there is zero chance the message will get seen and there would be a stuckpdnsutilprocess left.Also, there is no user documentation update yet until the preferred behaviour is decided.
Checklist
I have: