Index: Generator.java
===================================================================
--- Generator.java	(revision 1590497)
+++ Generator.java	(working copy)
@@ -545,10 +545,12 @@
     job.setOutputFormat(GeneratorOutputFormat.class);
 
     try {
-      JobClient.runJob(job);
-    } catch (IOException e) {
-      throw e;
-    }
+        JobClient.runJob(job);
+      } catch (IOException e) {
+        LockUtil.removeLockFile(fs, lock);
+        fs.delete(tempDir, true);
+        throw e;
+      }
 
     // read the subdirectories generated in the temp
     // output and turn them into segments
