-
Notifications
You must be signed in to change notification settings - Fork 60
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
POST operations need to handle intermittent network failure. #106
Comments
Help with this would be very much appreciated. This is causing significant issues with Nanosoldier, which is critical community infrastructure. |
Do you know what |
@KristofferC the request that is failing is I would like to help out, but I need to see more detailed logs of what is going on with Nanosoldier: JuliaWeb/HTTP.jl#220 (comment) |
See log analysis: JuliaWeb/HTTP.jl#220 (comment)
(To be reliable, GitHub.jl will still need to implement state-aware retry of non-idepmontent operations, but the changes above should improve failure rates in the short term). |
When a connection is returned to the (read) pool, add a monitor to it for receiving unexpected data (or EOF), and kill / close the Connection object if any activity occurs before the next write (when it should have simply been waiting idle in the pool) per JuliaLang/MbedTLS.jl#145 (comment) closes #214 closes #199 closes #220 closes JuliaWeb/GitHub.jl#106
* ConnectionPool: monitor idle connections When a connection is returned to the (read) pool, add a monitor to it for receiving unexpected data (or EOF), and kill / close the Connection object if any activity occurs before the next write (when it should have simply been waiting idle in the pool) per JuliaLang/MbedTLS.jl#145 (comment) closes #214 closes #199 closes #220 closes JuliaWeb/GitHub.jl#106 * - Encapsulate read|writebusy/sequence/count logic in new isbusy function. - Move close() on eof() || !isbusy() to new monitor_idle_connection function. - Make monitor_idle_connection() a noop for ::Connection{SSLContext} * require Julia 0.6.3 #236 (comment)
I think this probably should stay open per #106 (comment): "still need to implement state-aware retry of non-idepmontent operations" |
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 JuliaWeb/HTTP.jl#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.jlcreate_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 setretry_non_idempotent=true
).GitHub.jl/src/repositories/statuses.jl
Lines 30 to 33 in beb3659
See also JuliaWeb/HTTP.jl#214.
This issue may apply in other places that use
gh_post_json
.The text was updated successfully, but these errors were encountered: