Skip to content

Commit

Permalink
[FLINK-17792][tests] Catch and log exception if jstack fails
Browse files Browse the repository at this point in the history
jstack can fail if the JVM process that we want to sample exits while or
before we invoke jstack. Since a JVM process is free to exit at any
time, we should not propagate the exception so that we do not fail the
test prematurely.
  • Loading branch information
GJL committed May 18, 2020
1 parent 43c3bfa commit 417936d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flink-jepsen/src/jepsen/flink/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@

(defn- write-jstack!
[pid out-path]
(c/exec :jstack :-l pid :> out-path))
(try
(c/exec :jstack :-l pid :> out-path)
(catch Exception e
(warn e "Failed to invoke jstack on pid" pid))))

(defn dump-jstack-by-pattern!
"Dumps the output of jstack for all JVMs that match one of the specified patterns."
Expand Down

0 comments on commit 417936d

Please sign in to comment.