Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

fix: parse the response body message to determine retry backoff#249

Merged
nolanmar511 merged 3 commits intogoogleapis:masterfrom
nolanmar511:update-common
Jul 16, 2018
Merged

fix: parse the response body message to determine retry backoff#249
nolanmar511 merged 3 commits intogoogleapis:masterfrom
nolanmar511:update-common

Conversation

@nolanmar511
Copy link
Copy Markdown
Contributor

This fixes #245.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 11, 2018
Comment thread ts/test/test-profiler.ts
statusCode: 409,
body: {error: {details: [{retryDelay: '50s'}]}}
body: {
message: 'action throttled, backoff for 50s',

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread ts/src/profiler.ts Outdated
// The response currently does not have field containing the retry duration.
// As a work-around, response body's message is parsed to get the backoff
// duration.
// TODO: Remove this work-around and get the retry delay from

This comment was marked as spam.

This comment was marked as spam.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 12, 2018

Codecov Report

Merging #249 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #249      +/-   ##
========================================
+ Coverage   89.94%    90%   +0.05%     
========================================
  Files           6      6              
  Lines         388    390       +2     
  Branches       69     68       -1     
========================================
+ Hits          349    351       +2     
  Misses         39     39
Impacted Files Coverage Δ
ts/src/profiler.ts 95.85% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da64079...0d0cc16. Read the comment docs.

@nolanmar511
Copy link
Copy Markdown
Contributor Author

PTAL

Copy link
Copy Markdown
Contributor

@aalexand aalexand left a comment

Choose a reason for hiding this comment

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

Thank you, I think it's almost done, just couple comments.

Comment thread ts/src/profiler.ts Outdated
// The response currently does not have field containing the server-specified
// backoff. As a workaround, response body's message is parsed to get the
// backoff.
// TODO: Remove this work-around and get the retry delay from

This comment was marked as spam.

This comment was marked as spam.

Comment thread ts/src/profiler.ts Outdated
// The response currently does not have field containing the server-specified
// backoff. As a workaround, response body's message is parsed to get the
// backoff.
// TODO: Remove this work-around and get the retry delay from

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread ts/src/profiler.ts Outdated
*/
export function parseBackoffDuration(backoffStr: string): number|undefined {
const found = backoffStr.match(BACKOFF_MSG_PAT);
if (found && found.length >= 2 && typeof found[1] === 'string') {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

GTEST_VERSION="${GTEST_MIN_VERSION}"])

# TODO(chandlerc@google.com) Check the types, structures, and other compiler
# (chandlerc@google.com) Check the types, structures, and other compiler

This comment was marked as spam.

This comment was marked as spam.

Comment thread ts/src/profiler.ts Outdated
}


const BACKOFF_MSG_PATH =

This comment was marked as spam.

This comment was marked as spam.

@nolanmar511 nolanmar511 force-pushed the update-common branch 2 times, most recently from cf6ca14 to bb429ae Compare July 13, 2018 17:54
@nolanmar511
Copy link
Copy Markdown
Contributor Author

PTAL

@aalexand
Copy link
Copy Markdown
Contributor

@nolanmar511 The CI test failed on node10?

@aalexand
Copy link
Copy Markdown
Contributor

@nolanmar511 Please merge once node10 CI is passing. (assuming ofrobots@ doesn't have more comments)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server-specified backoff is broken

4 participants