This is an automated email from the ASF dual-hosted git repository.

xhsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new a22bf9c  [TE] Destroy PhantomJS process after 3 minutes timeout (#4247)
a22bf9c is described below

commit a22bf9c0b87d7d7f8599f48a387ecb26a7518479
Author: Xiaohui Sun <[email protected]>
AuthorDate: Tue May 28 15:00:13 2019 -0700

    [TE] Destroy PhantomJS process after 3 minutes timeout (#4247)
---
 .../pinot/thirdeye/anomaly/alert/util/EmailScreenshotHelper.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/util/EmailScreenshotHelper.java
 
b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/util/EmailScreenshotHelper.java
index f4064cf..beb2ae9 100644
--- 
a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/util/EmailScreenshotHelper.java
+++ 
b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/anomaly/alert/util/EmailScreenshotHelper.java
@@ -110,9 +110,10 @@ public class EmailScreenshotHelper {
         } while (line != null);
       }
     }
-    int exitVal = proc.waitFor();
-    if (exitVal != 0) {
-      throw new Exception("PhantomJS process failed with error code " + 
exitVal + ":\n" + sbError.toString());
+    boolean isComplete = proc.waitFor(3, TimeUnit.MINUTES);
+    if (!isComplete) {
+      proc.destroyForcibly();
+      throw new Exception("PhantomJS process timeout");
     }
     return imgPath;
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to