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: close GRPC channel when we dispose of clients #779

Merged
merged 18 commits into from
Dec 15, 2019

Conversation

schmidt-sebastian
Copy link
Contributor

See #768, especially #768 (comment)

This is a "Request for comments" PR if this is a viable strategy to dispose of unused GRPC clients, in the hope that this will mitigate memory leaks. If feasible, some of the code in this PR needs to be pushed upstream to the Gapic generator.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 8, 2019
@schmidt-sebastian schmidt-sebastian changed the title Call GrpcClient.close() when we dispose of clients fix: close GRPC channel when we dispose of clients Oct 8, 2019
@schmidt-sebastian
Copy link
Contributor Author

FYI @thebrianchen

@@ -401,7 +401,8 @@ export class Firestore {

logger('Firestore', null, 'Initialized Firestore GAPIC Client');
return client;
}
},
/* clientDestructor= */ (client: GapicClient) => client.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm - do we really have .close()? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not yet - but this PR shows how we could add it. We still have to add it to the Gapic generator though (if you are okay with the general direction).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexander-fenster Do you know what the next sets of steps would be if we wanted to add this support?

@schmidt-sebastian schmidt-sebastian changed the base branch from master to typescript December 15, 2019 02:09
@schmidt-sebastian
Copy link
Contributor Author

@alexander-fenster PR rebased against the Typescript branch and updated.

@schmidt-sebastian schmidt-sebastian changed the base branch from typescript to master December 15, 2019 12:19
@codecov
Copy link

codecov bot commented Dec 15, 2019

Codecov Report

Merging #779 into master will decrease coverage by 0.01%.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #779      +/-   ##
==========================================
- Coverage   90.36%   90.35%   -0.02%     
==========================================
  Files          25       25              
  Lines        2814     2820       +6     
  Branches      707      707              
==========================================
+ Hits         2543     2548       +5     
- Misses        118      119       +1     
  Partials      153      153
Impacted Files Coverage Δ
dev/src/index.ts 96.66% <0%> (-0.3%) ⬇️
dev/src/pool.ts 97.95% <100%> (+0.23%) ⬆️

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 5000b2d...77c66e5. Read the comment docs.

@schmidt-sebastian schmidt-sebastian added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 15, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 15, 2019
@schmidt-sebastian schmidt-sebastian merged commit 22ef0d0 into master Dec 15, 2019
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/shutdown branch December 15, 2019 21:41
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.

None yet

4 participants