Skip to content
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

Fails by timeout instead of retries because stdin of the child shell process is not closed (in contrast to standard Github Actions steps[*].run) #98

Open
avodonosov opened this issue Sep 16, 2022 · 1 comment
Assignees

Comments

@avodonosov
Copy link

avodonosov commented Sep 16, 2022

Describe the bug
Unlike the standard run step of the Github Actions, the nick-fields/retry step keeps open the standard input stream of the shell started to execute the command. In result, if a command tries to read from stdin, it hangs.

The standard Githup Actions runs the shell with closed stdin by default, so the commands trying to read from stdin exit immediately.

This is important, because when a crash happens (that I want to work-around with retries) my language implementation (Clozure Common Lisp) enters a "kernel debugger" which waits for console input.

So imagine a user experience: user copies the same command from standard github actions run hoping the nick-fields/retry will run it the same way, but gets a different behavior - instead of retry the program hangs for long time and then fails by timeout.

I observed this difference in behavior, and even found the code where the standarg actions closes stdin of the child shell process:
https://github.com/actions/runner/blob/cba19c4d7e1cf8071a4b4f7e24de98eb3d0e6d0f/src/Runner.Sdk/ProcessInvoker.cs#L317

Expected behavior
Behave the same as the standard github actions - close stdin of the shell.

Screenshots

Timeout when using the nick-fields/retry (note the 2 min timeout):
image

Immediate termination with the standard run step (note the 2s duration at the top right):

image

@avodonosov avodonosov changed the title Timeout instead of retry because stdin of the child shell process is not closed Fails by timeout instead of retries because stdin of the child shell process is not closed Sep 16, 2022
@avodonosov avodonosov changed the title Fails by timeout instead of retries because stdin of the child shell process is not closed Fails by timeout instead of retries because stdin of the child shell process is not closed (in contrast to standard Github Actions steps[*].run) Sep 16, 2022
@avodonosov
Copy link
Author

As a workaround I add < /dev/null to the command:
cl-plus-ssl/cl-plus-ssl@3c1b4cf

After that I finally get the desired retries:

image

image

PS: thank you for this retry tool!

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

No branches or pull requests

2 participants