From 08a08dd4c5f8d06a944b3bde9c561595ea0da606 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Wed, 17 Jun 2009 21:16:45 +0000
Subject: [PATCH] svn merge -r17877:17880
 https://eris.llnl.gov/svn/slurm/branches/slurm-2.0

---
 NEWS                           |  2 ++
 src/slurmctld/node_scheduler.c |  1 +
 src/slurmd/slurmstepd/io.c     | 15 ++++++++-------
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/NEWS b/NEWS
index 9c4a8661d63..5a7c5dfc508 100644
--- a/NEWS
+++ b/NEWS
@@ -55,6 +55,8 @@ documents those changes that are of interest to users and admins.
     into a reservation.
  -- In task/affinity plugin, add layer of abstraction to logic translating
     block masks to physical machine masks. Patch from Matthieu Hautreux, CEA.
+ -- Fix for setting the node_bitmap in a job to NULL if the job does not 
+    start correctly when expected to start.
 
 * Changes in SLURM 2.0.2
 ========================
diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c
index 49a9e33b6c3..c0eb5f64fc4 100644
--- a/src/slurmctld/node_scheduler.c
+++ b/src/slurmctld/node_scheduler.c
@@ -1109,6 +1109,7 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 		job_ptr->start_time = 0;
 		job_ptr->time_last_active = 0;
 		job_ptr->end_time = 0;
+		job_ptr->node_bitmap = NULL;
 		goto cleanup;
 	}
 
diff --git a/src/slurmd/slurmstepd/io.c b/src/slurmd/slurmstepd/io.c
index 061c14b8cbe..680faec492e 100644
--- a/src/slurmd/slurmstepd/io.c
+++ b/src/slurmd/slurmstepd/io.c
@@ -1028,15 +1028,16 @@ _init_task_stdio_fds(slurmd_task_info_t *task, slurmd_job_t *job)
 #ifdef HAVE_PTY_H
 	if (job->pty) {
 		if (task->gtid == 0) {
+			/* Make a file descriptor for the task to write to, but
+			   don't make a separate one read from, because in pty 
+			   mode we can't distinguish between stdout and stderr
+			   coming from the remote shell.  Both streams from the
+			   shell will go to task->stdout_fd, which is okay in 
+			   pty mode because any output routed through the stepd
+			   will be displayed. */
 			task->stderr_fd = dup(task->stdin_fd);
 			fd_set_close_on_exec(task->stderr_fd);
-			task->from_stderr = dup(task->to_stdin);
-			fd_set_close_on_exec(task->from_stderr);
-			fd_set_nonblocking(task->from_stderr);
-			task->err = _create_task_out_eio(task->from_stderr,
-						 SLURM_IO_STDERR, job, task);
-			list_append(job->stderr_eio_objs, (void *)task->err);
-			eio_new_initial_obj(job->eio, (void *)task->err);
+			task->from_stderr = -1;
 		} else {
 			xfree(task->efname);
 			task->efname = xstrdup("/dev/null");
-- 
GitLab