Skip to content

Ephemeral self-hosed runner should not try to restart #3822

Open
@maxknv

Description

@maxknv

Describe the bug
Ephemeral runner tries to restart on job cancellation.
Scenario:
Runner.Listner exits with a retriable error on job cancellation
runner log:

Job <JOB NAME> completed with result: Canceled | <RUNNER_ID>
Runner listener exit with retryable error, re-launch runner in 5 seconds.

For the ephemeral run, a restart does not make sense since the runner is unregistered, though runs.sh trying to restart the runner. See line:

echo "Restarting runner..."

which leads to an error:
Failed to create a session. The runner registration has been deleted from the server, please re-configure. Runner registrations are automatically deleted for runners that have not connected to the service recently.

To Reproduce
Steps to reproduce the behavior:

  1. config runner as ephemeral with ./config.sh .. --ephemeral
  2. start a runner with ./run.sh
  3. let it to run a job and cancel it
  4. observe the error

Expected behavior
Ephemeral runner should not try to restart on job cancellation or other exit errors

Runner Version and Platform

Version of your runner? any (2.323.0)

OS of the machine running the runner? linux

What's not working?

incorrect exit error handling for ephemeral case

Job Log Output

in description

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions