Commit 0451166
committed
xds: fix TSAN data races in xDS security components and tests
This change resolves several data races reported by ThreadSanitizer (TSAN)
in XdsSecurityClientServerTest and associated xDS security components.
Key changes:
- Made certificate, key storage, and SSL context fields volatile in
CertProviderSslContextProvider and DynamicSslContextProvider to ensure
safe publication between Netty EventLoop threads and background
FileWatcher threads.
- Made experimental static flags (enableSpiffe and
useChannelAuthorityIfNoSniApplicable) volatile. These flags are toggled
by tests while being read by background networking threads; making them
volatile ensures these transitions are thread-safe and TSAN-compliant.1 parent f90b881 commit 0451166
4 files changed
Lines changed: 7 additions & 7 deletions
File tree
- xds/src/main/java/io/grpc/xds/internal/security
- certprovider
- trust
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments