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

fix: stop using GRPC channels after RST_STREAM #1373

Merged
merged 2 commits into from
Dec 3, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

This PR is based on a theory (based on some anecdotal evidence) that once a GRPC Channel receives the first RST_STREAM error it will only every throw RST_STREAM errors. This PR changes our client pool to mark any GAX client that throws RST_STREAM as failed and ensures that the SDK spins up a new client for the next request.

Addresses #1023

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 3, 2020
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Dec 3, 2020
@codecov
Copy link

codecov bot commented Dec 3, 2020

Codecov Report

Merging #1373 (b23a7d7) into master (bae82dd) will decrease coverage by 0.00%.
The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1373      +/-   ##
==========================================
- Coverage   98.51%   98.51%   -0.01%     
==========================================
  Files          32       32              
  Lines       19440    19464      +24     
  Branches     1371     1375       +4     
==========================================
+ Hits        19152    19174      +22     
- Misses        284      286       +2     
  Partials        4        4              
Impacted Files Coverage Δ
dev/src/pool.ts 97.60% <92.59%> (-0.64%) ⬇️

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 bae82dd...b23a7d7. Read the comment docs.

dev/src/pool.ts Outdated
@@ -140,10 +149,19 @@ export class ClientPool<T> {
* @private
*/
private shouldGarbageCollectClient(client: T): boolean {
// Don't garbagae collect clients that have active requests.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

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.

LGTM with a minor nit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants