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: race-condition when re-creating server with external primary ip #590

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

apricote
Copy link
Member

@apricote apricote commented Nov 8, 2022

When re-creating a server with a primary ip, the replacement server creation failed due to a race condition:

  • initial server is deleted through terraform
  • API responds to server deletion
  • Primary IP is still marked as "attached" in API due to async internal process
  • Terraform tries to create new server
  • API call fails because primary API is still marked as "attached" and can not be used for new server

By waiting until the returned action from server delete is completed, we can fix this race condition.

Closes #558

When re-creating a server with a primary ip, the replacement server
creation failed due to a race condition:

- initial server is deleted through terraform
- API responds to server deletion
- Primary IP is still marked as "attached" in API due to async internal
  process
- Terraform tries to create new server
- API call fails because primary API is still marked as "attached" and
  can not be used for new server

By waiting until the returned action from server delete is completed, we
can fix this race condition.

Reported on GitHub: #558
@apricote apricote added the bug label Nov 8, 2022
@apricote apricote self-assigned this Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Recreating hcloud_server with primary IP created via extra resource fails
2 participants