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

Do not try to delete runner if script already running #1412

Merged
merged 1 commit into from Apr 30, 2024

Conversation

enescakir
Copy link
Member

We catch Octokit::Conflict exception with the "Already exists" message to ensure the register_runner function is idempotent. If it's run a second time, it fails with this exception.

Recently, we found a few examples with non-idempotent results. If this label run again after the start of the script, it fails with the following error:

Failed to start transient service unit: Unit runner-script.service
already exists

This PR fixes this issue by checking if the script is already running before trying to delete the runner.

Copy link
Collaborator

@fdr fdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all sustainable suggestions to disregard (and one is more a question)

prog/vm/github_runner.rb Outdated Show resolved Hide resolved
prog/vm/github_runner.rb Show resolved Hide resolved
prog/vm/github_runner.rb Show resolved Hide resolved
We catch Octokit::Conflict exception with the "Already exists" message
to ensure the `register_runner` function is idempotent. If it's run a
second time, it fails with this exception.

Recently, we found a few examples with non-idempotent results. If this
label run again after the start of the script, it fails with the
following error:

    Failed to start transient service unit: Unit runner-script.service
    already exists

This PR fixes this issue by checking if the script is already running
before trying to delete the runner.
@enescakir enescakir merged commit 50cad1f into main Apr 30, 2024
6 checks passed
@enescakir enescakir deleted the runner-register-idempotemt branch April 30, 2024 07:14
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants