Author: cutting
Date: Tue Aug 16 09:42:43 2005
New Revision: 233015
URL: http://svn.apache.org/viewcvs?rev=233015&view=rev
Log:
Increase default task timeout to 10 minutes, make configurable, & report
timeouts to job tracker.
Modified:
lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java
Modified:
lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java
URL:
http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java?rev=233015&r1=233014&r2=233015&view=diff
==============================================================================
---
lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java
(original)
+++
lucene/nutch/branches/mapred/src/java/org/apache/nutch/mapred/TaskTracker.java
Tue Aug 16 09:42:43 2005
@@ -37,7 +37,9 @@
NutchConf.get().getInt("mapred.tasktracker.tasks.maximum", 2);
static final long WAIT_FOR_DONE = 3 * 1000;
- static final long TASK_MIN_PROGRESS_INTERVAL = 60 * 1000;
+
+ static final long TASK_TIMEOUT =
+ NutchConf.get().getInt("mapred.task.timeout", 10* 60 * 1000);
static final int STALE_STATE = 1;
@@ -230,8 +232,9 @@
for (Iterator it = runningTasks.values().iterator();
it.hasNext(); ) {
TaskInProgress tip = (TaskInProgress) it.next();
if ((tip.getRunState() == TaskStatus.RUNNING) &&
- (System.currentTimeMillis() -
tip.getLastProgressReport() > TASK_MIN_PROGRESS_INTERVAL)) {
- LOG.info("Task " + tip.getTask().getTaskId() + " has
not reported progress for a long time. Killing...");
+ (System.currentTimeMillis() -
tip.getLastProgressReport() > TASK_TIMEOUT)) {
+ LOG.info("Task " + tip.getTask().getTaskId() + " timed
out. Killing.");
+ tip.reportDiagnosticInfo("Timed out.");
tip.cleanup();
}
}