Commit b2ad948
committed
fix(bigtable): resolve data race in ClientTest
Use CopyOnWriteArrayList instead of ArrayList in FakeBigtableService mock
implementation. The mock service receives gRPC requests on gRPC executor
threads and adds them to openSessionRequests and vrpcRequests. The test
thread reads these lists to verify client payloads. Without proper thread
synchronization, visibility and ordering issues can cause the test thread
to read a null element during ArrayList.add, resulting in a NullPointerException
in testMaterializedViewRequestSent.
BUG=b/481669998
TAG=agy
CONV=7b193e4d-38f8-450c-8475-0b9ae0d045071 parent b6cf4f9 commit b2ad948
1 file changed
Lines changed: 3 additions & 3 deletions
File tree
- java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | 48 | | |
50 | 49 | | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
| 260 | + | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
0 commit comments