-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move GrpcManagedChannelPool timeout parameters to GrpcChannel and Grp…
…cChannelBuilder (#8339) * Move channel timeout parameters into ManagedChannelPool.ChannelKey By moving the parameters into the channel key we can acquire and shutdown channels based on per-client configurations rather than using a load-once-per-jvm strategy that was used previously. The advantage of doing this is that users who choose to modify timeouts within the same JVM across different client objects will have those timeouts respected by the channel pool when acquiring and releasing channels. * Set timeouts in ChannelKey constructor By utilizing the constructor it will force us to use the defaults from configuration if the values are not set by the programmer. * Fix Checkstyle issues * remove timeouts from equality and hash code It's not required to put the health check timeout and shutdown timeout inside of the equality and hashCode functions for the ChannelKey. The shutdown of a channel will always immediately return if there are other references present. The last key to shut down the channel will respect the timeout however which is what we want. Similarly for health check which is only used when acquiring the channel - it will come from the key and is not stored with the channel so it is not required in those functions. * minor style fixes * move argument locations of timeouts ChannelKey may not have been the most intuitive place to place the parameters. Moving out the the GrpcChannel which wraps the ManagedChannel Reference and also using the configuration object from within the GrpcChannelBuilder in order to reference the timeouts.
- Loading branch information
Showing
6 changed files
with
75 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.