POST operations need to handle intermittent network failure.
#106 aperta il 17 mar 2018
Metriche repository
- Star
- (174 stelle)
- Metriche merge PR
- (Merge medio 2g 9h) (1 PR mergiata in 30 g)
Descrizione
The GitHub doc says that they have been careful to use HTTP methods with semantics appropriate to the API operations.
HTTP.jl retries most request automatically in the event of network failure. However, POST operations are not generally idempotent and cannot be automatically retried. GitHub.jl should implement system-state-aware retry loops around POST requests. i.e. when a POST operation throws an HTTP.IOError GitHub.jl should retry the operation in a way that avoids duplicate changes to system state.
In the case of the create_status operation that is the subject of https://github.com/JuliaWeb/HTTP.jl/issues/220, POST /repos/:owner/:repo/statuses/:sha, it seems that double-posting would create two statuses, https://developer.github.com/v3/repos/statuses/, so in the event of a failure, the GitHub.jl create_status function should do a GET to check if the status was created before retrying (or, if duplicate statuses are not considered harmful to overall system correctness, just set retry_non_idempotent=true).
See also https://github.com/JuliaWeb/HTTP.jl/issues/214.
This issue may apply in other places that use gh_post_json.