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

Restart a task running over PCP if it errors with 'puppetlabs.orchestrator/plan-already-finished' #2964

Closed
lucywyman opened this issue Aug 2, 2021 · 0 comments · Fixed by #2971
Labels
Feature New features and improvements.

Comments

@lucywyman
Copy link
Contributor

Use Case

When running a task through the Orchestrator, the task gets added to PuppetDB with a plan ID for it to run as part of, in order to work with the Orchestrator API. If the Orchestrator is restarted as part of the task (for example as part of the peadm::pe_install task), it will fail with the error "The plan has already finished". This happens because when Orchestrator restarts it marks any running plans as failed, which also means they are interpreted as "finished". This is correct, however Bolt is using Orchestrator as a transport and doesn't care about whether the associated plan ID still exists or what it's state is, it just needs to use the Orchestrator to connect to targets and run the task.

To solve this, we can catch the plan-finished error and rerun the task with a new plan ID.

Questions

  • How many times should we catch the error? Just once? Make it configurable?
  • Are there other instances where we shouldn't catch the error and retry? (I can't think of any).
@lucywyman lucywyman added the Feature New features and improvements. label Aug 2, 2021
beechtom added a commit that referenced this issue Aug 6, 2021
(GH-2964) Restart a task over PCP if it fails with 'plan-already-finished'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New features and improvements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant