-
Notifications
You must be signed in to change notification settings - Fork 106
Shutdown GRPC managed channel properly on close #628
Conversation
Codecov Report
@@ Coverage Diff @@
## master #628 +/- ##
============================================
- Coverage 74.94% 74.81% -0.14%
- Complexity 935 936 +1
============================================
Files 177 178 +1
Lines 4099 4117 +18
Branches 328 329 +1
============================================
+ Hits 3072 3080 +8
- Misses 874 884 +10
Partials 153 153
Continue to review full report at Codecov.
|
@@ -91,6 +91,13 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted | |||
@Override | |||
public void close() { | |||
getManagedChannel().shutdown(); | |||
boolean terminated = false; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,40 @@ | |||
/* | |||
* Copyright 2018 Google LLC |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -91,6 +92,11 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted | |||
@Override | |||
public void close() { | |||
getManagedChannel().shutdown(); | |||
try { | |||
getManagedChannel().awaitTermination(6, TimeUnit.MINUTES); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
LGTM
Fix #3912, 3693 & 3648 Shutdown GRPC Managed channel properly on closing of background resources.