Skip to content

hq job info crashes when piped to head #851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lahwaacz opened this issue Mar 14, 2025 · 3 comments · Fixed by #855
Closed

hq job info crashes when piped to head #851

lahwaacz opened this issue Mar 14, 2025 · 3 comments · Fixed by #855

Comments

@lahwaacz
Copy link
Contributor

I just did:

$ hq job info 3 | head
+----------------------+--------------------------------------------+
| ID                   | 3                                          |
| Name                 |                                            |
| State                | [###############.........................] |
|                      | RUNNING (148)                              |
|                      | FAILED (1)                                 |
|                      | FINISHED (511)                             |
|                      | CANCELED (1)                               |
|                      | WAITING (1495)                             |
| Session              | closed                                     |
2025-03-14T20:29:39Z ERROR Cannot print table to stdout: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }

thread 'main' panicked at library/std/src/io/stdio.rs:1123:9:
failed printing to stdout: Broken pipe (os error 32)
stack backtrace:
   0:     0x563037152e6a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::he089f96442833f67
   1:     0x563037181823 - core::fmt::write::h2f210ed4c94745cb
   2:     0x56303714e503 - std::io::Write::write_fmt::h7de08171ab770fb2
   3:     0x563037152cb2 - std::sys::backtrace::BacktraceLock::print::h810fbd31421329e6
   4:     0x5630371540d0 - std::panicking::default_hook::{{closure}}::hbaad47ed9dc6356d
   5:     0x563037153eb0 - std::panicking::default_hook::h24e207139139d40a
   6:     0x563036bc89d1 - hq::main::{{closure}}::{{closure}}::hccf81f73b4a8672a
Oops, HyperQueue has crashed. This is a bug, sorry for that.
If you would be so kind, please report this issue at the HQ issue tracker: https://github.com/It4innovations/hyperqueue/issues/new?title=HQ%20crashes
Please include the above error (starting from "thread ... panicked ...") and the stack backtrace in the issue contents, along with the following information:

HyperQueue version: 0.21.0-dev

You can also re-run HyperQueue server (and its workers) with the `RUST_LOG=hq=debug,tako=debug`
environment variable, and attach the logs to the issue, to provide us more information.

The full output is quite long (so I tried to use head 😄) and I need to redact some paths, but let me know if something important is missing.

hq.log

@lahwaacz
Copy link
Contributor Author

HQ is built from source at ddfee03.

@spirali
Copy link
Collaborator

spirali commented Mar 14, 2025

As I understand the problem: Rust catches SIGPIPE and propagates it as an io error. So to be a compatible with standard UNIX cli apps, we should just silently quit on BrokenPipe error.

@Kobzol
Copy link
Collaborator

Kobzol commented Mar 14, 2025

Yeah this is a known Rust thing (rust-lang/rust#62569). We should deal with SIGPIPE properly to make this work, it makes sense to pipe certain hq commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants