-
-
Notifications
You must be signed in to change notification settings - Fork 15
Add retry logic for server creation with configurable attempts and delay (fixes #8) #10
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
Add retry logic for server creation with configurable attempts and delay (fixes #8) #10
Conversation
Introduce create_retries and create_retry_delay inputs to control the number of retry attempts and delay between attempts when creating a Hetzner Cloud server. Update action.sh to implement the retry loop and improve error handling for transient failures. Document new options in README.md and action.yml to enhance reliability.
|
Ok, thanks for the new revised pull. Now I can read and understand it much better. In curl there is a built-in retry. Wouldn't that be enough? Then we could avoid the extra loop. Documentation: https://everything.curl.dev/usingcurl/downloads/retry.html Example: curl --retry 12 --retry-all-errors "https://api.hetzner.cloud/v1/servers" |
|
The
Summary: |
|
I have a question about the curl version and the retry mechanism. I'm trying to understand the reasoning behind the suggested changes fully. Since the script runs in a GitHub Actions runner with a standard image, are we concerned about the curl version not supporting Also, I'm wondering if retrying on all non-zero exit codes is the best approach. For example, if the API returns a 401, should we really keep retrying? |
The main issue is "resource unavailability," where Cloud Servers are unavailable because of resource exhaustion. This has happened since last year, and I face it every day from 10 a.m. to 12 p.m. German time. When I tested the branch by releasing the Action to the marketplace (that is why I had to delete the last word "Cloud" once in the prior PR, as duplicate Actions are not allowed), I had set 50 tries, and the Cloud server was created on the 27th try (see the screenshot). Hetzner's notice on this issue since last year: https://status.hetzner.com/incident/aa5ce33b-faa5-4fd0-9782-fde43cd270cf |
|
@Cyclenerd thanks for accepting the PR. I am guessing that only one variable was added named Did I get it right? I think an update to the example template in the readme.md would be helpful :) |
|
Yes: Default: |
|
In my opinion, no further help than the description and explanation in the table is necessary. In the example, it is likely to confuse many because it only affects a very small number of people. |
|
This is how I have defined the new parameter. Is this correct? |

This PR introduces built-in, configurable retry logic to the runner creation step in the Hetzner GitHub Action. By allowing users to specify the number of retry attempts and the delay between attempts, the goal is to improve robustness against transient API/network errors or mitigate temporary resource unavailability issue.
Key Changes
1. New Inputs in
action.ymlcreate_retries: Number of retry attempts for runner creation (default: 1).create_retry_delay: Delay (in seconds) between attempts (default: 10).2. Retry Logic in
action.shcurl -X POST ...) in a retry loop:3. Documentation in
README.mdcreate_retriesandcreate_retry_delay.Example Usage
Motivation
Style & Compatibility
MY_variables, lowercase functions, tab indentation, and preservation of comments.Closes: #8