Skip to content

Commit afe9b41

Browse files
authored
Ensure PID files are cleaned up after migration (#2905)
Now that we now longer create PID files for new workloads, ensure they get cleaned up during the status migration process.
1 parent b34f7d3 commit afe9b41

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/workloads/statuses/file_status.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,11 @@ func (*fileStatusManager) migratePIDFromFile(workloadName string, containerInfo
430430
}
431431
logger.Debugf("found PID %d in PID file for workload %s, will update status file", pid, workloadName)
432432

433-
// TODO: reinstate this once we decide to completely get rid of PID files.
434433
// Delete the PID file after successful migration
435-
/*if err := process.RemovePIDFile(baseName); err != nil {
434+
if err := process.RemovePIDFile(baseName); err != nil {
436435
logger.Warnf("failed to remove PID file for workload %s (base name: %s): %v", workloadName, baseName, err)
437436
// Don't return false here - the migration succeeded, cleanup just failed
438-
}*/
437+
}
439438

440439
return pid, true
441440
}

0 commit comments

Comments
 (0)