-
Notifications
You must be signed in to change notification settings - Fork 375
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
Adds timeout functions to sdk/base package #7617
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also bump the package version and update the release notes:
https://github.com/celo-org/celo-monorepo/blob/master/packages/sdk/CHANGELOG.md#L0-L1
cc @medhak1
IIRC We don't want to pollute |
c8cb56b
to
1a716ae
Compare
This reverts commit ed9040e.
* Adds timeout functions to sdk/base package (#7617) ### Description In our efforts to improve ODIS scalability, the CAP team came across the need for these timeout async functions and they seemed like something that should be added to the base package. We've added retryAsyncWithBackOffWithTimeout() and timeout(). The former retries an async function up to a given number of times with a backoff between each retry and caps the attempt to call the function with a timeout. The timeout() function simply calls an async function and wraps the promise in a timeout. Authorship credit goes to @codyborn who wrote the timeout logic in a separate PR ### Tested Unit tests added to async.test.ts ### Related issues None ### Backwards compatibility Yes ### Documentation None * adds requestID to logger in common pkg * assign sessionID in combiner if not provided by client * bumps common package version * bumps package versions * ODIS Combiner Reliability (#7594) ### Description - Adding timeouts to full-node requests - “Failing open” when timeouts are hit - Forcing outstanding request termination when k of m signatures have been collected - Forcing outstanding request termination and returning early when k of m signatures are not possible ### Tested - Test cases for new async method wrapper - TODO: Deploy to alfajores and perform load tests to measure impact ### Backwards compatibility Yes ### Documentation N/A * export base through common package * bumps common pkg version * bumps pkgs in signer Co-authored-by: Cody Born <codyborn@outlook.com>
* adds timeouts to signer * moves timeout function to base package, adds signer timeout metric * udpates dependency graph * fixes typo * fixes error * adds backup timeout at express level * addresses feedback * import timeout through common package * moves backup timeout to better spot * removes commented out code * parallelizes db ops * adds TODOS * adds timeout helper to sdk/base * adds retryAsyncWithTimeout helper to sdk/base * refactors retryAsyncWithBackOffAndTimeout() to use timeout() * bumps package version and updates changelog * adds docs * Revert "bumps package version and updates changelog" This reverts commit ed9040e. * Adds timeout functions to sdk/base package (#7617) ### Description In our efforts to improve ODIS scalability, the CAP team came across the need for these timeout async functions and they seemed like something that should be added to the base package. We've added retryAsyncWithBackOffWithTimeout() and timeout(). The former retries an async function up to a given number of times with a backoff between each retry and caps the attempt to call the function with a timeout. The timeout() function simply calls an async function and wraps the promise in a timeout. Authorship credit goes to @codyborn who wrote the timeout logic in a separate PR ### Tested Unit tests added to async.test.ts ### Related issues None ### Backwards compatibility Yes ### Documentation None * add full node timeouts to signer * adds db timeouts to signer * adds dependency graph * ODIS Combiner Reliability (#7594) ### Description - Adding timeouts to full-node requests - “Failing open” when timeouts are hit - Forcing outstanding request termination when k of m signatures have been collected - Forcing outstanding request termination and returning early when k of m signatures are not possible ### Tested - Test cases for new async method wrapper - TODO: Deploy to alfajores and perform load tests to measure impact ### Backwards compatibility Yes ### Documentation N/A * ODIS load test (#7602) Integrates load test logic into monitor * update dependency graph * adds sdk/base to signer dockerfile (temporary) Co-authored-by: Cody Born <codyborn@outlook.com>
Description
In our efforts to improve ODIS scalability, the CAP team came across the need for these timeout async functions and they seemed like something that should be added to the base package.
We've added retryAsyncWithBackOffWithTimeout() and timeout(). The former retries an async function up to a given number of times with a backoff between each retry and caps the attempt to call the function with a timeout. The timeout() function simply calls an async function and wraps the promise in a timeout.
Authorship credit goes to @codyborn who wrote the timeout logic in a separate PR
Tested
Unit tests added to async.test.ts
Related issues
None
Backwards compatibility
Yes
Documentation
None