Skip to content

Commit 95ed979

Browse files
committed
Can't during reconcile, it's not in the state
Signed-off-by: Benjamin Leggett <[email protected]>
1 parent 89f3afb commit 95ed979

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/inpod/statemanager.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ impl WorkloadProxyManagerState {
182182
// as it should be auto-dropped subsequently during snapshot reconcile(), when
183183
// we actually get the `SnapshotSent` notification.
184184
self.snapshot_names.remove(&workload_uid);
185+
// `reconcile()` will drop this workload later, but if the workload never successfully
186+
// starts it will stay in the pending queue (which `reconcile()` can't remove it from),
187+
// so clear the pending queue here.
188+
self.pending_workloads.remove(&workload_uid);
185189
return Ok(());
186190
}
187191
self.del_workload(&workload_uid);
@@ -203,13 +207,11 @@ impl WorkloadProxyManagerState {
203207
// reconcile existing state to snaphsot. drains any workloads not in the snapshot
204208
// this can happen if workloads were removed while we were disconnected.
205209
fn reconcile(&mut self) {
206-
for (wl_uid, workload_state) in self
210+
for (_, workload_state) in self
207211
.workload_states
208212
.extract_if(|uid, _| !self.snapshot_names.contains(uid))
209213
{
210214
self.draining.shutdown_workload(workload_state);
211-
// Also clear pending queue if we have something stuck in there for this UID
212-
self.pending_workloads.remove(&wl_uid);
213215
}
214216
self.snapshot_names.clear();
215217
self.update_proxy_count_metrics();

0 commit comments

Comments
 (0)