Ticket 10470 - Failure in slurm_spank_task_post_fork drains the node
Summary: Failure in slurm_spank_task_post_fork drains the node
Status: RESOLVED INFOGIVEN
Alias: None
Product: Slurm
Classification: Unclassified
Component: Other (show other tickets)
Version: 20.11.1
Hardware: Linux Linux
: 4 - Minor Issue
Assignee: Marshall Garey
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2020-12-16 17:53 MST by Luke Yeager
Modified: 2021-02-05 14:23 MST (History)
2 users (show)

See Also:
Site: NVIDIA (PSLA)
Slinky Site: ---
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
Google sites: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
NoveTech Sites: ---
Nvidia HWinf-CS Sites: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Tzag Elita Sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed:
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments

Note You need to log in before you can comment on or make changes to this ticket.
Description Luke Yeager 2020-12-16 17:53:53 MST
While investigating bug#7573, I realized that failures in slurm_spank_task_post_fork() are really brutal, and ultimately result in the node being drained for 'Kill task failed' (after ~10mins):


$ salloc srun hostname
salloc: Granted job allocation 273
salloc: Waiting for resource configuration
salloc: Nodes node-1 are ready for job
slurmstepd-node-1: error: spank: required plugin spank.so: task_post_fork() failed with rc=-1
slurmstepd-node-1: error: spank task 0 post-fork failed
slurmstepd-node-1: error: _exec_wait_child_wait_for_parent: failed: Operation now in progress
slurmstepd-node-1: error: *** STEP 273.0 STEPD TERMINATED ON node-1 AT 2020-12-16T16:14:14 DUE TO JOB NOT ENDING WITH SIGNALS ***
srun: error: timeout waiting for task launch, started 0 of 1 tasks
srun: launch/slurm: launch_p_step_launch: StepId=273.0 aborted before step completely launched.
srun: Job step aborted: Waiting up to 32 seconds for job step to finish.
srun: error: Timed out waiting for job step to complete


>Dec 16 16:13:11 slurmstepd[786131]: error: spank: required plugin spank.so: task_post_fork() failed with rc=-1
>Dec 16 16:13:11 slurmstepd[786131]: error: spank extern task post-fork failed
>Dec 16 16:13:14 slurmctld[783385]: ====================
>Dec 16 16:13:14 slurmctld[783385]: JobId=273 StepId=0
>Dec 16 16:13:14 slurmctld[783385]: JobNode[0] Socket[0] Core[0] is allocated
>Dec 16 16:13:14 slurmctld[783385]: ====================
>Dec 16 16:13:14 slurmd-node-1[783377]: launch task StepId=273.0 request from UID:1000 GID:1000 HOST:10.110.40.105 PORT:49244
>Dec 16 16:13:14 slurmd-node-1[783377]: ====================
>Dec 16 16:13:14 slurmd-node-1[783377]: StepId=273.0 job_mem:0MB step_mem:0MB
>Dec 16 16:13:14 slurmd-node-1[783377]: JobNode[0] CPU[0] Step alloc
>Dec 16 16:13:14 slurmd-node-1[783377]: JobNode[0] CPU[1] Job alloc
>Dec 16 16:13:14 slurmd-node-1[783377]: JobNode[0] CPU[2] Job alloc
>Dec 16 16:13:14 slurmd-node-1[783377]: JobNode[0] CPU[3] Job alloc
>Dec 16 16:13:14 slurmd-node-1[783377]: JobNode[0] CPU[4] Job alloc
>Dec 16 16:13:14 slurmd-node-1[783377]: JobNode[0] CPU[5] Job alloc
>Dec 16 16:13:14 slurmd-node-1[783377]: ====================
>Dec 16 16:13:14 slurmd-node-1[783377]: Scaling CPU count by factor of 2 (12/(6-0))
>Dec 16 16:13:14 slurmd-node-1[783377]: task/affinity: lllp_distribution: entire node must be allocated, disabling affinity
>Dec 16 16:13:14 slurmd-node-1[783377]: task/affinity: lllp_distribution: JobId=273 manual binding: mask_cpu
>Dec 16 16:13:14 slurmstepd-node-1[786148]: error: spank: required plugin spank.so: task_post_fork() failed with rc=-1
>Dec 16 16:13:14 slurmstepd-node-1[786148]: error: spank task 0 post-fork failed
>Dec 16 16:13:14 slurmstepd-node-1[786153]: error: _exec_wait_child_wait_for_parent: failed: Operation now in progress
>Dec 16 16:14:15 slurmstepd-node-1[786148]: error: *** STEP 273.0 STEPD TERMINATED ON node-1 AT 2020-12-16T16:14:14 DUE TO JOB NOT ENDING WITH SIGNALS ***
>Dec 16 16:14:15 slurmctld[783385]: update_node: node node-1 reason set to: Kill task failed
>Dec 16 16:14:15 slurmctld[783385]: update_node: node node-1 state set to DRAINING
>Dec 16 16:14:15 slurmstepd-node-1[786148]: done with job
>Dec 16 16:23:14 slurmctld[783385]: job_step_signal: JobId=273 StepId=0 not found
>Dec 16 16:23:45 slurmctld[783385]: job_step_signal: JobId=273 StepId=0 not found
>Dec 16 16:23:45 slurmctld[783385]: _job_complete: JobId=273 WEXITSTATUS 0
>Dec 16 16:23:45 slurmctld[783385]: _job_complete: JobId=273 done
>Dec 16 16:23:45 slurmstepd[786131]: done with job

We don't have any SPANK plugins which use this entrypoint, so this is not currently high priority for our site.
Comment 1 Marshall Garey 2020-12-21 14:20:09 MST
Thanks for the report Luke. I'll look into it and let you know if I can reproduce it or not
Comment 5 Marshall Garey 2021-02-03 16:51:23 MST
Hi Luke,

Sorry for the delayed response. I'm not able to reproduce the "kill task failed" error leading to a drained node.

Briefly, here's what happens in the code:

_fork_all_tasks() -> spank_task_post_fork().

If that errors, then goto fail2 and return back to job_manager().

Back in job_manager(), it does a goto fail3 since _fork_all_tasks() failed. Here it starts and stops the step terminate monitor thread. This is the thread that the KillWait timeout. So in between these start/stop calls slurmstepd is waiting for the processes to finish but they aren't getting killed.

The proctrack_g_signal() call signals the processes, and proctrack_g_wait() waits for 2 minutes or until those processes are killed.

	_set_job_state(job, SLURMSTEPD_STEP_ENDING);
	step_terminate_monitor_start(job);
	if (job->cont_id != 0) {
		proctrack_g_signal(job->cont_id, SIGKILL);
		proctrack_g_wait(job->cont_id);
	}
	step_terminate_monitor_stop();



We can see this happen in the log file:

>Dec 16 16:13:14 slurmstepd-node-1[786148]: error: spank task 0 post-fork failed
>Dec 16 16:13:14 slurmstepd-node-1[786153]: error: _exec_wait_child_wait_for_parent: failed: Operation now in progress
>Dec 16 16:14:15 slurmstepd-node-1[786148]: error: *** STEP 273.0 STEPD TERMINATED ON node-1 AT 2020-12-16T16:14:14 DUE TO JOB NOT ENDING WITH SIGNALS ***
>Dec 16 16:14:15 slurmctld[783385]: update_node: node node-1 reason set to: Kill task failed
>Dec 16 16:14:15 slurmctld[783385]: update_node: node node-1 state set to DRAINING



That "STEPD TERMINATED ON ... DUE TO JOB NOT ENDING WITH SIGNALS" happens in the step terminate monitor thread.


Anyway, the short of it is that the processes aren't getting killed for some reason, but they normally should be.

* What do you have ProctrackType set to in slurm.conf?
* Does this "kill task failed" and node draining happen every single time there is a failure in slurm_spank_task_post_fork()? What is the job doing? Have you tried different types of jobs (like a job that just sleeps or calls hostname or something like that)?
Comment 6 Luke Yeager 2021-02-03 17:12:37 MST
(In reply to Marshall Garey from comment #5)
> * What do you have ProctrackType set to in slurm.conf?
That was the right question, it seems. I was using proctrack/pgid (an old config I was testing and forgot to revert on my local workstation). When I switched to proctrack/cgroup the cleanup happens as expected. Quickly and without draining.

Since we don't use that proctrack plugin anywhere at our site, this isn't a problem for us. I'd be curious to know if you can reproduce it with that proctrack plugin yourself, though. It does repro consistently for me.
Comment 7 Marshall Garey 2021-02-05 14:23:17 MST
Yes, it reproduces for me with proctrack/pgid. It also ends up with a defunct slurmstepd process.

That's demonstrates why we recommend proctrack/cgroup, and not the other proctrack plugins.

I'm closing this as infogiven. Let me know if you have more questions.
Comment 8 Marshall Garey 2021-02-05 14:23:38 MST
Actually closing the bug this time. Sorry about the extra email.