iTwin / insights-client

MIT License
1 stars 6 forks source link

Retry requests that failed due to transient network issues #79

Closed JulijaRamoskiene closed 12 hours ago

JulijaRamoskiene commented 5 days ago

Retry requests when they failed due to transient network error. Currently only requests with 429 responses are retried here: https://github.com/iTwin/insights-client/blob/main/src/common/OperationsBase.ts

Sample of request that should be re-tried: Image

Suggested error and status codes for re-try:

StatusCodes: 408, 413, 429, 500, 502, 503, 504, 521, 522, 524

ErrorCodes: "ETIMEDOUT", "ECONNRESET", "EADDRINUSE", "ECONNREFUSED", "EPIPE", "ENOTFOUND", "ENETUNREACH", "EAI_AGAIN", "ECONNABORTED"

MindaugasButkus commented 5 days ago

Will not add retries for 413 (Content Too Large) - retrying will not reduce the content size.

MindaugasButkus commented 10 hours ago

Version 0.15.0 published with this change.