RSE-9: Fix : Job Remote Option URL "retry" connection parameter is not honored #7856
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rundeck does not honor the retry settings mentioned here:
https://docs.rundeck.com/docs/administration/configuration/config-file-reference.html#job-remote-option-url-connection-parameters
Or here:
https://docs.rundeck.com/docs/manual/job-options.html#url-connection-parameters
Only the Timeout is honored, no retries are made.
Fix: https://github.com/rundeckpro/rundeckpro/issues/2644
Problem:
When a job option was set from a remote URL the retry param was not taken in count, any retry was made.
There are two ways of setting those configurations, directly on the URL or the config.properties, the ones from the config.properties weren't being used.
Solution:
On the RundeckBaseConfig add the missing params to be accessible when the params are set on the rundeck-config.file
The method used to obtain the values from the remote URL is now inside a cycle where the status of the HTTP request is evaluated, if the response code obtained is different than a successful response, Rundeck will retry as many times as the user has set or until the response code is valid. If the user has set the connection timeout, this cycle will wait the time specified before making a retry.
A similar solution is already implemented on the code on rundeckapp/grails-app/services/rundeck/services/NotificationService.groovy on the postDataUrl method