I see thanks for the investigation. That code was added in: [torchelastic] Improve process termination logic (#61602) · pytorch/pytorch@0c55f1b · GitHub 1
This only affects worker (not agent) exception handling so I’m still not understanding why you suspect this is the reason why scale down is not working when a SIGTERM is sent to the agent