Fix potential deadlock when k8s client is used#2031
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2031 +/- ##
==========================================
+ Coverage 67.15% 67.19% +0.03%
==========================================
Files 213 214 +1
Lines 8991 9019 +28
==========================================
+ Hits 6038 6060 +22
- Misses 2682 2686 +4
- Partials 271 273 +2
Continue to review full report at Codecov.
|
|
|
|
|
||
| // InitForTesting initialize the necessary global variables for unit tests. | ||
| func InitForTesting() { | ||
| setupMetricsWorker() |
There was a problem hiding this comment.
I think this is already called due to init?
There was a problem hiding this comment.
Nope that was really weird because I thought init from the metrics package (since it is imported) it would be call first but it does not. It fails with a nil pointer exception when it tries to access the mWorker instance.
Let me double check maybe something messed up.
There was a problem hiding this comment.
Cant reproduce it will update.
|
@evankanderson gentle ping. |
evankanderson
left a comment
There was a problem hiding this comment.
Other than the unit test failure, this looks reasonable to me.
| err = <-updateCmd.done | ||
| return err |
There was a problem hiding this comment.
I think this can be return <-updateCmd.done
|
Running main and your branch 84 times, I see about an equivalent number of failures (8 vs 9(, but there seems to be a lot more output on failure with this PR, and I see a timeout/missing data failure in the OpenCensus export in addition to the /retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evankanderson The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
@evankanderson I have seen that test failing multiple times in my other pr #2005, left a comment there, so I am not sure if this is any different. I will try to debug that and see if it can be fixed in another PR (I am out this week btw). |
Changes
registered metrics hooks in the client.
/kind bug
Fixes #807
/cc @vagababov @evankanderson