[GH-ISSUE #2432] dns-test: Stop using TTY in docker exec #989

Closed
opened 2026-03-16 01:12:06 +03:00 by kerem · 0 comments
Owner

Originally created by @divergentdave on GitHub (Sep 5, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2432

Is your feature request related to a problem? Please describe.
I kept stress-testing one conformance test after fixing #2421, and I found that sometimes the output from ldns-signzone would get truncated, either losing the second line, or losing two columns from one of the lines. (less frequently than the seconds underflow issue, but still repeatable, given enough time) There was no message on stderr indicating why, and the status code was still successful. I confirmed the container was still running by exec-ing id after ldns-signzone, and saw that still worked when the signed zone output got truncated.

Describe the solution you'd like
I tried removing the -t flag from docker exec in the relevant place, and I haven't seen any more truncation issues from this command. I've seen a few complaints of other weird output truncation issues with docker exec -t while searching around the internet, but didn't find a complete explanation. At any rate, not using a TTY where we don't need it should simplify things.

One additional benefit of not using -t is that docker exec no longer combines the process's stdout and stderr into its own stdout, so we could remove some hacks in tshark.rs that redirect one stream to a file, and cat it later. The downside is that we have to remove those hacks, and in the case of tshark, read from both stdout and stderr simultaneously on two threads, so processes doesn't get blocked on full buffers.

$ docker exec -t busybox sh -c 'echo hello world; ls whoops' 2>/dev/null
hello world
ls: whoops: No such file or directory
$ docker exec -t busybox sh -c 'echo hello world; ls whoops' 1>/dev/null
$ docker exec busybox sh -c 'echo hello world; ls whoops' 2>/dev/null
hello world
$ docker exec busybox sh -c 'echo hello world; ls whoops' 1>/dev/null
ls: whoops: No such file or directory

Describe alternatives you've considered
Keep the status quo

Originally created by @divergentdave on GitHub (Sep 5, 2024). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2432 **Is your feature request related to a problem? Please describe.** I kept stress-testing one conformance test after fixing #2421, and I found that sometimes the output from `ldns-signzone` would get truncated, either losing the second line, or losing two columns from one of the lines. (less frequently than the seconds underflow issue, but still repeatable, given enough time) There was no message on stderr indicating why, and the status code was still successful. I confirmed the container was still running by exec-ing `id` after `ldns-signzone`, and saw that still worked when the signed zone output got truncated. **Describe the solution you'd like** I tried removing the `-t` flag from `docker exec` in the relevant place, and I haven't seen any more truncation issues from this command. I've seen a few complaints of other weird output truncation issues with `docker exec -t` while searching around the internet, but didn't find a complete explanation. At any rate, not using a TTY where we don't need it should simplify things. One additional benefit of not using `-t` is that `docker exec` no longer combines the process's stdout and stderr into its own stdout, so we could remove some hacks in `tshark.rs` that redirect one stream to a file, and `cat` it later. The downside is that we have to remove those hacks, and in the case of `tshark`, read from both stdout and stderr simultaneously on two threads, so processes doesn't get blocked on full buffers. ``` $ docker exec -t busybox sh -c 'echo hello world; ls whoops' 2>/dev/null hello world ls: whoops: No such file or directory $ docker exec -t busybox sh -c 'echo hello world; ls whoops' 1>/dev/null $ docker exec busybox sh -c 'echo hello world; ls whoops' 2>/dev/null hello world $ docker exec busybox sh -c 'echo hello world; ls whoops' 1>/dev/null ls: whoops: No such file or directory ``` **Describe alternatives you've considered** Keep the status quo
kerem closed this issue 2026-03-16 01:12:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#989
No description provided.