Commit 5cbf18f
committed
Replace AtomicReference with synchronized in VirtualClusterLifecycleManager
The AtomicReference approach had a race between state.get() and
state.updateAndGet() where another thread could advance the state,
causing incorrect log messages. Using synchronized makes the
read-transition-log sequence atomic. This is sufficient for the
single-shot proxy lifecycle where contention is not a concern.
Also adjusts log levels: INFO for significant states (Serving, Failed,
Stopped), DEBUG for intermediate transitions (Draining).
Closes kroxylicious#3696
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>1 parent ccc99a2 commit 5cbf18f
1 file changed
Lines changed: 11 additions & 12 deletions
File tree
- kroxylicious-runtime/src/main/java/io/kroxylicious/proxy/internal
Lines changed: 11 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
103 | | - | |
104 | | - | |
| 104 | + | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| |||
0 commit comments