Commit 8345db4
committed
[SPARK-52559] Synchronize
### What changes were proposed in this pull request?
This PR aims to fix a concurrency issue by synchronizing `SparkOperatorConfManager.getValue`.
### Why are the changes needed?
`configOverrides` is supposed by being protected by `this` at `refresh` method.
https://github.com/apache/spark-kubernetes-operator/blob/35214b00c777c724d9cd40208601839824811346/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/SparkOperatorConfManager.java#L71-L76
However, currently `getValue` can access an empty value while `refresh` invokes `this.configOverrides = new Properties();` statement because `getValue` method is not synchronized properly.
https://github.com/apache/spark-kubernetes-operator/blob/35214b00c777c724d9cd40208601839824811346/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/SparkOperatorConfManager.java#L62-L65
### Does this PR introduce _any_ user-facing change?
Yes, this is a bug fix.
### How was this patch tested?
Manual review. (It's a little difficult to add a concurrency failure test case).
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes apache#256 from dongjoon-hyun/SPARK-52559.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>SparkOperatorConfManager.getValue
1 parent 35214b0 commit 8345db4
File tree
1 file changed
+4
-2
lines changed- spark-operator/src/main/java/org/apache/spark/k8s/operator/config
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
0 commit comments