# plugin: hooks can't wedge on stdin or a full stderr pipe \(\#17\) · lucenx/signaltty

[View on GitCafe](https://git.cafe/lucenx/signaltty/commit/0bc42aa2965c247f80e9b77e2aaae5e91e0d1a93)

Repository: [lucenx/signaltty](https://git.cafe/lucenx/signaltty)

Visibility: public

Requested revision: 0bc42aa2965c247f80e9b77e2aaae5e91e0d1a93

Requested commit: 0bc42aa2965c247f80e9b77e2aaae5e91e0d1a93

Commit: 0bc42aa2965c247f80e9b77e2aaae5e91e0d1a93

Tree: 438d78ce6d7e119bf07b26385065c16899f5994b

Author: Simone

Committer: GitHub

## Message

```
plugin: hooks can't wedge on stdin or a full stderr pipe (#17)

run_hook wrote the envelope to stdin before draining and outside the
timeout, so a hook that never reads a large envelope blocked the runner
until it exited and was then marked failed with EPIPE. The drains ran
one after the other, so a hook that filled stderr while stdout was still
open deadlocked until the timeout killed it.

Now stdin, stdout and stderr are serviced concurrently with the wait,
all under the hook deadline; EPIPE on stdin is not a failure, and a
grandchild holding the pipes open can't keep the permit past the
deadline. Tests cover both cases plus stderr capture on failure.

Co-authored-by: Grok Bot <grokbot@users.noreply.github.com>
```

## Parents

- [4d7ffcc5597607a2e910841f9868d059e900136a](https://git.cafe/lucenx/signaltty/commit/4d7ffcc5597607a2e910841f9868d059e900136a?format=markdown)

[Source at this commit](https://git.cafe/lucenx/signaltty/tree/0bc42aa2965c247f80e9b77e2aaae5e91e0d1a93?format=markdown)
