Skip to content
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

feat: more information for exceed timeout error #839

Merged
merged 11 commits into from
Jun 2, 2020
Merged

Conversation

xiaozhenliu-gg5
Copy link
Contributor

@xiaozhenliu-gg5 xiaozhenliu-gg5 commented Jun 1, 2020

fix #741

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 1, 2020
@codecov
Copy link

codecov bot commented Jun 1, 2020

Codecov Report

Merging #839 into master will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #839      +/-   ##
==========================================
- Coverage   89.74%   89.70%   -0.04%     
==========================================
  Files          46       46              
  Lines        7432     7443      +11     
  Branches      514      517       +3     
==========================================
+ Hits         6670     6677       +7     
- Misses        759      763       +4     
  Partials        3        3              
Impacted Files Coverage Δ
src/createApiCall.ts 98.24% <100.00%> (+0.01%) ⬆️
src/gax.ts 96.43% <100.00%> (+0.04%) ⬆️
src/normalCalls/retries.ts 98.72% <100.00%> (+<0.01%) ⬆️
.mocharc.js 78.57% <0.00%> (-14.29%) ⬇️

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 2273188...f1a8b26. Read the comment docs.

@alexander-fenster
Copy link
Contributor

You know I'm deeply afraid of code changes that have no test coverage :) Can you make sure this code is covered by a unit test?

Copy link
Contributor

@alexander-fenster alexander-fenster left a comment

Choose a reason for hiding this comment

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

Let's test it please.

@xiaozhenliu-gg5
Copy link
Contributor Author

Sure, @alexander-fenster added a unit test to verify the error message. Based on the information from #839, add function name, total time it takes, and retry settings to the message.

assert.ok(err instanceof GoogleError);
assert.strictEqual(
err.message,
'Function takes 100 milliseconds which exceeds retry total timeout 100 milliseconds before any response was received. The retry settings is {"initialRetryDelayMillis":0,"retryDelayMultiplier":0,"maxRetryDelayMillis":0,"initialRpcTimeoutMillis":0,"rpcTimeoutMultiplier":0,"maxRpcTimeoutMillis":0,"totalTimeoutMillis":100}.'
Copy link
Contributor

Choose a reason for hiding this comment

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

The function name is missing here - is it a test setup problem, or a problem with func.name in the code? Will it actually work with the real function call?

Copy link
Contributor

Choose a reason for hiding this comment

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

In general, this is a user facing error message, and I'm not sure we need to dump the whole JSON object here - maybe just the total timeout (the one that is compared to)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, the name of function name is empty here, actually not sure the function name is helpful because users might just want to know which API they are calling.
re: timeout setting: I will just print out the total timeout value.

@alexander-fenster
Copy link
Contributor

alexander-fenster commented Jun 2, 2020

Should it say "fix #741" instead of "fix #839"? :)

If it's for #741 then in its current form it does not help unfortunately, because what the user specifically asked for is

I tried to debug which API call and which library emit this error message, but I couldn't because the error message and stack trace don't provide any information other than 'Retry total timeout exceeded before any response was received'.

We still don't print which API is being called...

@xiaozhenliu-gg5
Copy link
Contributor Author

pass the apiName to the createApiCall and print out the useful information from the error message. This also requires setting api name from micro-generator side.

@xiaozhenliu-gg5 xiaozhenliu-gg5 changed the title chore: more information for exceed timeout error feat: more information for exceed timeout error Jun 2, 2020
Copy link
Contributor

@alexander-fenster alexander-fenster left a comment

Choose a reason for hiding this comment

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

OK this looks really good now!

@xiaozhenliu-gg5 xiaozhenliu-gg5 merged commit c401b80 into master Jun 2, 2020
@xiaozhenliu-gg5 xiaozhenliu-gg5 deleted the retry-info branch June 2, 2020 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more information on "Retry total timeout exceeded before any response was received" error.
3 participants