Skip to content

Commit

Permalink
Avoid locking the job_list when unneeded.
Browse files Browse the repository at this point in the history
Bug 5443
  • Loading branch information
fafik23 authored and dannyauble committed Oct 26, 2018
1 parent a39a343 commit 85e97dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -12,6 +12,7 @@ documents those changes that are of interest to users and administrators.
-- When building rpms ignore redundant standard rpaths and insecure relative
rpaths, for RHEL based distros which use "check-rpaths" tool.
-- Don't skip jobs in scontrol hold.
-- Avoid locking the job_list when unneeded.

* Changes in Slurm 18.08.3
==========================
Expand Down
14 changes: 10 additions & 4 deletions src/slurmctld/agent.c
Expand Up @@ -711,25 +711,31 @@ static void _notify_slurmctld_nodes(agent_info_t *agent_ptr,
ret_data_info_t *ret_data_info = NULL;
state_t state;
int is_ret_list = 1;
/* Locks: Read config, write job, write node */
/* Locks: Read config, write node */
slurmctld_lock_t node_write_lock =
{ READ_LOCK, WRITE_LOCK, WRITE_LOCK, NO_LOCK, READ_LOCK };
{ .conf = READ_LOCK, .node = WRITE_LOCK };
thd_t *thread_ptr = agent_ptr->thread_struct;
int i;

/* Notify slurmctld of non-responding nodes */
if (no_resp_cnt) {
/* Update node table data for non-responding nodes */
lock_slurmctld(node_write_lock);
if (agent_ptr->msg_type == REQUEST_BATCH_JOB_LAUNCH) {
/* Requeue the request */
batch_job_launch_msg_t *launch_msg_ptr =
*agent_ptr->msg_args_pptr;
uint32_t job_id = launch_msg_ptr->job_id;
/* Locks: Write job, write node, read federation */
slurmctld_lock_t job_write_lock =
{ .job = WRITE_LOCK,
.node = WRITE_LOCK,
.fed = READ_LOCK };

lock_slurmctld(job_write_lock);
job_complete(job_id, slurmctld_conf.slurm_user_id,
true, false, 0);
unlock_slurmctld(job_write_lock);
}
unlock_slurmctld(node_write_lock);
}
if (retry_cnt && agent_ptr->retry)
_queue_agent_retry(agent_ptr, retry_cnt);
Expand Down

0 comments on commit 85e97dc

Please sign in to comment.