Skip to content

Don't retry curl errors for REST#3712

Merged
ihnorton merged 1 commit intodevfrom
sethshelnutt/sc-23862/don-t-retry-rest-request-on-curl-error
Dec 7, 2022
Merged

Don't retry curl errors for REST#3712
ihnorton merged 1 commit intodevfrom
sethshelnutt/sc-23862/don-t-retry-rest-request-on-curl-error

Conversation

@Shelnutt2
Copy link
Copy Markdown
Contributor

If we received a curl error we should not resubmit the original request. There are some curl errors that can occur after we have received partial results and we might have already deserialized and copied data into the user buffer. Retries resubmit the initial request not accounting for any partial state.


TYPE: IMPROVEMENT
DESC: Do not resubmit http requests for curl errors for REST requests

@shortcut-integration
Copy link
Copy Markdown

This pull request has been linked to Shortcut Story #23862: Don't retry REST request on curl error.

Comment thread tiledb/sm/rest/curl.cc Outdated
Comment thread tiledb/sm/rest/curl.cc Outdated
*curl_code = tmp_curl_code;
}

/* If there is a write error we should not attempt a retry */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. IMO we should combine with the if block above for clarity
  2. IIUC the only condition leading to a retry now will be an HTTP status in one of the retry_http_codes_. Is that correct? If so I think we should add a comment to clarify.

If we received a curl error we should not resubmit the original request. There
are some curl errors that can occur after we have received partial results and
we might have already deserialized and copied data into the user buffer.
Retries resubmit the initial request not accounting for any partial state.
@Shelnutt2 Shelnutt2 force-pushed the sethshelnutt/sc-23862/don-t-retry-rest-request-on-curl-error branch from d577512 to 7c78be6 Compare December 2, 2022 15:46
@Shelnutt2 Shelnutt2 requested a review from ihnorton December 2, 2022 15:48
@ihnorton ihnorton merged commit 8c370ab into dev Dec 7, 2022
@ihnorton ihnorton deleted the sethshelnutt/sc-23862/don-t-retry-rest-request-on-curl-error branch December 7, 2022 21:12
github-actions Bot pushed a commit that referenced this pull request Dec 7, 2022
If we received a curl error we should not resubmit the original request. There are some curl errors that can occur after we have received partial results and we might have already deserialized and copied data into the user buffer. Retries resubmit the initial request not accounting for any partial state.


---
TYPE: IMPROVEMENT
DESC: Do not resubmit http requests for curl errors for REST requests
ihnorton pushed a commit that referenced this pull request Dec 8, 2022
If we received a curl error we should not resubmit the original request. There are some curl errors that can occur after we have received partial results and we might have already deserialized and copied data into the user buffer. Retries resubmit the initial request not accounting for any partial state.


---
TYPE: IMPROVEMENT
DESC: Do not resubmit http requests for curl errors for REST requests

Co-authored-by: Seth Shelnutt <[email protected]>
KiterLuc pushed a commit that referenced this pull request Sep 4, 2024
Core-side retries on curl errors have been explicitly disallowed in the
past in #3712 to protect from
double writes in case of errors in a connection teardown phase, so after
a fragment has been written, where a retry would just re-write the same
fragment.

However, we have experienced spurious "Connection reset by peer" type of
errors especially during ingestion (Write queries), which we think could
be mitigating by allowing retries for most of curl errors. (exclude
those that typically happen during connection teardown).


[[sc-54377](https://app.shortcut.com/tiledb-inc/story/54277/enable-retries-for-most-curl-error-codes-in-core)]

---
TYPE: IMPROVEMENT
DESC: Enable curl error retries.

---------

Co-authored-by: Shaun M Reed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants