-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Bug]: race condition when reloading TLS certificates #4316
Comments
@yurishkuro I am trying to reproduce the error by writing a test case. Is this the right approach to identify the problem you are referring in the issue?
|
Yes, and you can do this all in a unit test, such that if run with For step 1 you don't need to generate new certs, we already have working pairs as text fixtures in the tlscfg package. |
@yurishkuro sorry got busy.
Not able to reproduce race conditions at
as mentioned in comment I will try to spend some more time on this |
Hey @yurishkuro ! I was trying to reproduce this issue. So I came up with two tests, first test |
Both the test are provoking Data Race conditions.
|
Does it mean your tests reliably reproduce data race? If so, great job! Can you create a PR adding those tests? And since you're deep into this, do you see a way to fix this? |
## Which problem is this PR solving? - Part of #4316 --------- Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com> Signed-off-by: Yuri Shkuro <github@ysh.us> Co-authored-by: Yuri Shkuro <github@ysh.us> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
## Which problem is this PR solving? - Part of #4316 ## Description of the changes - ## How was this change tested? - ## Checklist - [ ] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com>
## Which problem is this PR solving? - Part of #4316 ## Description of the changes - ## How was this change tested? - ## Checklist - [ ] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com> Signed-off-by: chahat sagar <109112505+chahatsagarmain@users.noreply.github.com> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
## Which problem is this PR solving? - Part of #4316 ## Description of the changes - ## How was this change tested? - ## Checklist - [ ] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: chahatsagarmain <chahatsagar2003@gmail.com>
What happened?
This is a continuation of this discussion: #4260 (comment)
Steps to reproduce
We can probably reproduce it by creating a unit test (which will run with
-race
) that does the following:Expected behavior
We expect that changes to certificates in a server take effect on future client connections. Instead, the test described above should detect a race condition as we try to update the same certPools that are already being used by the server (and therefore will be read on new client connections).
Relevant log output
No response
Screenshot
No response
Additional context
The rough proposal would be as follows:
tls.Config.GetConfigForClient
function by returning a new config with certPools retrieved from certWatcher (similar to how we already define cfg.Get{Client}Certificate functions). This way the server will be using immutable tls configs and cert poolsNB: this probably would not address the issue of reloading root CA for the server or the client, perhaps we should not be even supporting it. GetConfigForClient would only allow supporting reloading of ClientCA on the server, per @tsaarni 's comment.
Jaeger backend version
No response
SDK
No response
Pipeline
No response
Stogage backend
No response
Operating system
No response
Deployment model
No response
Deployment configs
No response
The text was updated successfully, but these errors were encountered: