Skip to content

Conversation

@xgboosted
Copy link
Contributor

@xgboosted xgboosted commented Jun 4, 2025

Enhanced server deletion reliability by implementing a retry loop that continues attempting to delete the server if the initial request fails. This helps handle transient API failures and ensures that cleanup is completed because of the newly added infinite loop.

Please Complete the Following

Enhance server deletion reliability by implementing a retry loop that
continues attempting to delete the server if initial requests fail.
This helps handle transient API failures and ensures cleanup completion.
@xgboosted xgboosted changed the title Add retry logic for Hetzner server deletion Add retry logic for Hetzner server deletion (#11) Jun 4, 2025
@xgboosted xgboosted changed the title Add retry logic for Hetzner server deletion (#11) Add retry logic for Hetzner server deletion (resolves #11) Jun 4, 2025
@xgboosted
Copy link
Contributor Author

#11

@Cyclenerd
Copy link
Owner

Why not curl --retry this time as discussed in #10 ? Error 503 from #11 is mentioned explicitly in the help (https://everything.curl.dev/usingcurl/downloads/retry.html). Seems perfect to me this time.

@xgboosted
Copy link
Contributor Author

xgboosted commented Jun 4, 2025

I simply wrapped your existing code block inside a do loop, so no extra function was called. We do not need to track any error code at all, the server will get deleted no matter whatever error code was raised.

@Cyclenerd
Copy link
Owner

Regarding your proposed solution with the while true loop for deleting the Hetzner Cloud server, I've decided not to merge it. While I understand the intent to ensure the server is eventually deleted, an endless while loop combined with repeated HTTP GET requests isn't the most ideal approach for this specific problem.

As we discussed in #10 and #11, curl --retry offers a more elegant and efficient way to handle transient network issues and 503 errors. It's designed for exactly this kind of scenario, providing built-in retry logic with back-off, which is generally more robust than a manual endless while loop.

@xgboosted
Copy link
Contributor Author

@Cyclenerd would you be implementing the curl --rerty logic to cover both the create server and delete server steps?

@Cyclenerd
Copy link
Owner

I will only implement curl retry for deleting the server. If the API is not stable when the server is created, there is no reason to create it. We will make further API requests later i.e. to check the status of the server.

@Cyclenerd Cyclenerd closed this Jun 9, 2025
@xgboosted
Copy link
Contributor Author

We will make further API requests later i.e. to check the status of the server.

I saw that the new PR was merged. Has this been implemented in this one?

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.

2 participants