@@ -182,6 +182,10 @@ impl WorkloadProxyManagerState {
182
182
// as it should be auto-dropped subsequently during snapshot reconcile(), when
183
183
// we actually get the `SnapshotSent` notification.
184
184
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) ;
185
189
return Ok ( ( ) ) ;
186
190
}
187
191
self . del_workload ( & workload_uid) ;
@@ -203,13 +207,11 @@ impl WorkloadProxyManagerState {
203
207
// reconcile existing state to snaphsot. drains any workloads not in the snapshot
204
208
// this can happen if workloads were removed while we were disconnected.
205
209
fn reconcile ( & mut self ) {
206
- for ( wl_uid , workload_state) in self
210
+ for ( _ , workload_state) in self
207
211
. workload_states
208
212
. extract_if ( |uid, _| !self . snapshot_names . contains ( uid) )
209
213
{
210
214
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) ;
213
215
}
214
216
self . snapshot_names . clear ( ) ;
215
217
self . update_proxy_count_metrics ( ) ;
0 commit comments