- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/Ohana
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/Ohana merged eligible /branches/eam_branches/Ohana.20100407 27635-27772 /branches/pap_delete/Ohana 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/tap_branches/Ohana/src/opihi/pcontrol/CheckIdleHost.c
r25872 r27838 1 1 # include "pcontrol.h" 2 2 3 // The connection to the remote host is only allow to live for MAX_CONNECT_TIME seconds. We4 // disconnect and reconnect if a remote host has been connected for too long. This is a5 // (temporary?) work-around for the problem that the remote pclient job tends to grow too large6 // over time.3 // The connection to the remote host is only allowed to live for MAX_CONNECT_TIME seconds. 4 // We disconnect and reconnect if a remote host has been connected for too long. This is 5 // a (temporary?) work-around for the problem that the remote pclient job tends to grow 6 // too large over time. 7 7 8 # define MAX_CONNECT_TIME 36000.0 9 8 static float MAX_WANTHOST_WAIT = 10.0; 9 static float MAX_CONNECT_TIME = 36000.0; 10 10 static FILE *logfile = NULL; 11 11 … … 70 70 71 71 // if (logfile) fprintf (logfile, "start needhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]); 72 AddMachineJob (host, job); 72 73 73 74 /* take the job off the stack and unlock the stack */ … … 90 91 91 92 // if (logfile) fprintf (logfile, "start wanthost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]); 93 AddMachineJob (host, job); 92 94 93 95 /* take the job off the stack and unlock the stack */ … … 103 105 if (job[0].mode != PCONTROL_JOB_ANYHOST) continue; 104 106 107 if (!CheckMachineJobs (host, job)) continue; 108 105 109 /* we have found an appropriate job; link it to the host and send to StartJob */ 106 110 job[0].host = (struct Host *) host; … … 108 112 109 113 // if (logfile) fprintf (logfile, "start anyhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]); 114 AddMachineJob (host, job); 110 115 111 116 /* take the job off the stack and unlock the stack */ … … 124 129 gettimeofday (&now, (void *) NULL); 125 130 dtime = DTIME (now, job[0].start); 126 if (dtime < 10.0) continue; 131 if (dtime < MAX_WANTHOST_WAIT) continue; 132 133 if (!CheckMachineJobs (host, job)) continue; 127 134 128 135 if (logfile) fprintf (logfile, "start wanthost(2) %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]); 136 AddMachineJob (host, job); 129 137 130 138 /* we have found an appropriate job; link it to the host and send to StartJob */ … … 145 153 } 146 154 155 void SetMaxWantHostWait (float value) { 156 157 MAX_WANTHOST_WAIT = value; 158 return; 159 } 160 161 float GetMaxWantHostWait (void) { 162 163 return MAX_WANTHOST_WAIT; 164 } 165 166 void SetMaxConnectTime (float value) { 167 168 MAX_CONNECT_TIME = value; 169 return; 170 } 171 172 float GetMaxConnectTime (void) { 173 174 return MAX_CONNECT_TIME; 175 } 176 147 177 /** note : host and job popped off IDLE and PENDING stacks, 148 178 unless no job is available **/
Note:
See TracChangeset
for help on using the changeset viewer.
