IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20066


Ignore:
Timestamp:
Oct 10, 2008, 4:51:28 PM (18 years ago)
Author:
eugene
Message:

correctly sequence stdout and stderr; keep job state while waiting for buffered data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/CheckDoneJob.c

    r20059 r20066  
    1212  ASSERT (job == (Job *) host[0].job, "invalid job");
    1313
     14  // we have four possible states here:
     15  // 1) stdout & stderr not yet requested
     16  // 2) stdout requested, not yet completed
     17  // 3) stdout completed, stderr not yet requested
     18  // 4) stdout completed, stderr requested, stderr not yet completed
     19
     20  // we can always call this for stdout (if it is done, this is a NOP)
    1421  status1 = GetJobOutput ("stdout", host, &job[0].stdout);
    15   status2 = GetJobOutput ("stderr", host, &job[0].stderr);
     22
     23  // we cannot try stderr until stdout is completed
     24  status2 = PCLIENT_HUNG;
     25  if (job[0].stdout.completed) {
     26      status2 = GetJobOutput ("stderr", host, &job[0].stderr);
     27  }
    1628
    1729  if ((status1 == PCLIENT_DOWN) || (status2 == PCLIENT_DOWN)) {
     
    3749    PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
    3850    ASSERT (job[0].host, "host not set for job");
    39     PutJob (job, PCONTROL_JOB_DONE, STACK_BOTTOM);
     51    PutJobSetState (job, PCONTROL_JOB_DONE, STACK_BOTTOM, job[0].state); // keep the incoming state
    4052    return (FALSE);
    4153  }
Note: See TracChangeset for help on using the changeset viewer.