-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Regression in Nomad 1.9.0: Stdin might not be closed in Docker exec #24171
Comments
I just added the reproduction example as a small repository on GitHub: https://github.com/MrSerth/nomad-exec There, I also included the reproduction example with a GitHub Actions pipeline, clearly showing the impact of the Nomad version: https://github.com/MrSerth/nomad-exec/actions/runs/11294633497 |
Awesome, thanks @shoenig for your work on this issue and the e2e test. I can confirm that your changes solve the issue reported. Furthermore, our test suite is now completing successfully given a Nomad binary from the current |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Since updating to Nomad 1.9.0, I am observing a weird behavior I cannot explain. Below is a bug report, since I would classify the behavior as a release regression from Nomad 1.9.0. The same code works flawlessly in Nomad 1.8.4 and lower.
Potentially, this issue is caused by switching to the native Docker library as done with #23966.
The issue is that in some circumstances (with a relatively short input buffer), an allocation Exec doesn't close stdin, so that the command within the allocation keeps waiting. The attached job file and the Go code were extracted from our production setup. They demonstrate the erroneous behavior, but might still be too large. For now, I didn't manage to reduce the example further.
I tried many different steps to nail down the problem, but couldn't. Any help would be greatly appreciated!
Nomad version
Operating system and Environment details
Ubuntu 24.04.1 LTS and macOS 15.0.1
Issue
When a command in an allocation that waits for stdin is executed, the stream might not be closed as expected. This prevents the command to complete successfully.
Reproduction steps
Download the following reproduction_example.zip and execute it with
go run example.go
.Please note a few things:
Exec
command is measured. This length is important and triggering the issue: A buffer size of 10,000 or less will not work, a buffer size of 10,000 or more works.Expected Result
The reproduction example succeeds:
Actual Result
The reproduction example hangs:
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
The text was updated successfully, but these errors were encountered: