retry icon indicating copy to clipboard operation
retry copied to clipboard

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

Open avodonosov opened this issue 2 years ago • 1 comments

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 avatar Sep 16 '22 21:09 avodonosov

As a workaround I add < /dev/null to the command: https://github.com/cl-plus-ssl/cl-plus-ssl/commit/3c1b4cf5ff8c16034ebcd0927c83f273720211af

After that I finally get the desired retries:

image

image

PS: thank you for this retry tool!

avodonosov avatar Sep 16 '22 23:09 avodonosov