Commit e269dd2
committed
fix: resolve readiness WaitReady blocking for 5 minutes on startup
Backport fixes from upstream apache/apisix-ingress-controller#2663.
Root cause: readiness.Start() is asynchronous. If a controller's
reconcile loop calls Done() before Start() finishes registering
resources, Done() finds no state entry and returns early. The resource
is never removed from state, causing WaitReady to block until the
5-minute timeout.
Changes:
- Done() now waits for Start() to complete (<-r.started) before
operating on state, eliminating the race condition
- WaitReady() returns false on timeout instead of true (semantic fix:
timed-out != ready)
- Remove unnecessary mutex in registerState() since Done() is now
guaranteed to run after Start() closes r.started
- Add log statements for easier debugging of readiness lifecycle1 parent b02e842 commit e269dd2
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
143 | | - | |
144 | | - | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
194 | | - | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
| |||
0 commit comments