Skip to content

Minor GRPC cleanups#2646

Closed
cyli wants to merge 3 commits intomoby:masterfrom
cyli:grpc-cleanups
Closed

Minor GRPC cleanups#2646
cyli wants to merge 3 commits intomoby:masterfrom
cyli:grpc-cleanups

Conversation

@cyli
Copy link
Copy Markdown
Contributor

@cyli cyli commented May 23, 2018

This PR does 4 things:

  1. Our MutableTLSCreds.Clone function creates a new MutableTLSCreds object with the TLS config, which should not be re-used. Previously, GRPC never called clone on the creds, but in 1.10.x, it does. Our code should just call tls.Config's Clone function anyway, because we should not be passing the same config object to multiple connections. This should fix some issues with [WIP] Update grpc etc #2631.

  2. Our tests call grpclog.SetLogger in TestMain functions sometimes - the docs say that it should be set only in init functions. Calling it in TestMain can cause races. This should fix some issues with [WIP] Update grpc etc #2631.

  3. Stops using grpclog.SetLogger, which is deprecated, and calls grpc.SetLoggerV2 instead. This required converting a logrus.Entry into something that satisfies the grpclog.LoggerV2 interface. I just did this since I was messing around with the logger anyway for the tests.

  4. Deletes some extra code in role_manager_test.go that didn't seem to be called from anywhere.

cc @thaJeztah

cyli added 3 commits May 23, 2018 15:37
Signed-off-by: Ying Li <ying.li@docker.com>
…gger

to discard in test init functions, rather than in TestMain functions as is
documented by the `SetLoggerV2` function.  Also, use `SetLoggerV2` since
SetLogger is deprecated.

Signed-off-by: Ying Li <ying.li@docker.com>
entry into a grpc LoggerV2, since the grpc Logger is deprecated.

Signed-off-by: Ying Li <ying.li@docker.com>
@cyli cyli force-pushed the grpc-cleanups branch from 527b61c to b21f075 Compare May 23, 2018 22:39
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2018

Codecov Report

Merging #2646 into master will decrease coverage by 0.04%.
The diff coverage is 80%.

@@            Coverage Diff             @@
##           master    #2646      +/-   ##
==========================================
- Coverage   61.85%   61.81%   -0.05%     
==========================================
  Files         134      134              
  Lines       21823    21826       +3     
==========================================
- Hits        13499    13491       -8     
- Misses       6869     6893      +24     
+ Partials     1455     1442      -13

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

SGTM 👍

@cyli cyli mentioned this pull request May 25, 2018
@cyli
Copy link
Copy Markdown
Contributor Author

cyli commented May 29, 2018

Will just close this in favor of #2649 since that includes these changes anyway.

@cyli cyli closed this May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants