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

fix: case where a runner ends up reserved without a timeout #393

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

alecthomas
Copy link
Collaborator

I believe this was being triggered when a controller creates a reservation transaction, issues the reservation to a runner, then dies before being able to complete the transaction. This leaves the runner in a state where it is telling controllers it's reserved, without having set a reservation_timeout, as the only place that was previously set was during the reservation transaction. The UpsertRunner calls were not setting this.

To work around this, and another potential issue, I've added two triggers:

  1. When a runner is set to the reserved state with a NULL reservation_timeout, set it to a default of 2m.
  2. Update runner.module_name whenever runner.deployment_id is set or unset.

Fixes #392

I believe this was being triggered when a controller creates a
reservation transaction, issues the reservation to a runner, then dies
before being able to complete the transaction. This leaves the runner in
a state where it is telling controllers it's reserved, without having
set a reservation_timeout, as the only place that was previously set was
during the reservation transaction. The UpsertRunner calls were not
setting this.

To work around this, and another potential issue, I've added two
triggers:

1. When a runner is set to the reserved state with a NULL
   reservation_timeout, set it to a default of 2m.
2. Update runner.module_name whenever runner.deployment_id is set or
   unset.

Fixes #392
@alecthomas alecthomas enabled auto-merge (squash) September 18, 2023 05:10
@alecthomas alecthomas disabled auto-merge September 18, 2023 05:10
@alecthomas alecthomas merged commit a55de4a into main Sep 18, 2023
@alecthomas alecthomas deleted the aat/fix-runner-invalid-reserved-state branch September 18, 2023 05:10
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

Successfully merging this pull request may close these issues.

Runner database entry ends up in an invalid state under some circumstances
1 participant