Skip to content
Snippets Groups Projects
Commit bbda4331 authored by Mark Grondona's avatar Mark Grondona
Browse files

o fix for file descriptor leak in slurmd.c (service_connection)

parent 3a5349d9
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ documents those changes that are of interest to users and admins. ...@@ -18,6 +18,7 @@ documents those changes that are of interest to users and admins.
still processing job completion. This will work properly for still processing job completion. This will work properly for
shared nodes. shared nodes.
-- Set SLURM_DISTRIBUTION environment varible for user tasks. -- Set SLURM_DISTRIBUTION environment varible for user tasks.
-- Fix for file descriptor leak in slurmd.
* Changes in SLURM 0.3.0.0-pre9 * Changes in SLURM 0.3.0.0-pre9
=============================== ===============================
......
...@@ -320,24 +320,19 @@ _service_connection(void *arg) ...@@ -320,24 +320,19 @@ _service_connection(void *arg)
conn_t *con = (conn_t *) arg; conn_t *con = (conn_t *) arg;
slurm_msg_t *msg = xmalloc(sizeof(*msg)); slurm_msg_t *msg = xmalloc(sizeof(*msg));
if ((rc = slurm_receive_msg(con->fd, msg, 0)) < 0) { /* set msg connection fd to accepted fd. This allows
* possibility for slurmd_req () to close accepted connection
*/
msg->conn_fd = con->fd;
if ((rc = slurm_receive_msg(con->fd, msg, 0)) < 0)
error("slurm_receive_msg: %m"); error("slurm_receive_msg: %m");
goto done; else
} else {
msg->conn_fd = con->fd;
slurmd_req(msg, con->cli_addr); slurmd_req(msg, con->cli_addr);
}
/*
* Check to see if fd already closed
*/
if (msg->conn_fd < 0)
goto done;
if (slurm_close_accepted_conn(msg->conn_fd) < 0) if ((msg->conn_fd >= 0) && slurm_close_accepted_conn(msg->conn_fd) < 0)
error ("close(%d): %m", con->fd); error ("close(%d): %m", con->fd);
done:
xfree(con->cli_addr); xfree(con->cli_addr);
xfree(con); xfree(con);
slurm_free_msg(msg); slurm_free_msg(msg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment