[ 
https://issues.apache.org/jira/browse/FLINK-10063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16569829#comment-16569829
 ] 

ASF GitHub Bot commented on FLINK-10063:
----------------------------------------

cewood commented on a change in pull request #6496: [FLINK-10063][tests] Use 
runit to supervise mesos processes.
URL: https://github.com/apache/flink/pull/6496#discussion_r207793002
 
 

 ##########
 File path: flink-jepsen/src/jepsen/flink/mesos.clj
 ##########
 @@ -24,11 +24,35 @@
             [jepsen.os.debian :as debian]
             [jepsen.flink.zookeeper :refer [zookeeper-uri]]))
 
+;;; runit process supervisor (http://smarden.org/runit/)
+;;;
+;;; We use runit to supervise Mesos processes because Mesos uses a "fail-fast" 
approach to
+;;; error handling, e.g., the Mesos master will exit when it discovers it has 
been partitioned away
+;;; from the Zookeeper quorum.
+
+(def runit-version "2.1.2-3")
+
+(defn create-supervised-service!
+  "Registers a service with the process supervisor and starts it."
+  [service-name cmd]
+  (let [service-dir (str "/etc/sv/" service-name)
+        run-script (str service-dir "/run")]
+    (c/su
+      (c/exec :mkdir :-p service-dir)
+      (c/exec :echo (clojure.string/join "\n" ["#!/bin/sh" cmd]) :> run-script)
 
 Review comment:
   It's generally considered best practice for runit units to include an `exec 
2>&1` line, and to prefix your command with `exec ...`. So I'd suggest updating 
this line accordingly; `["#!/bin/sh" "exec 2>&1" (str "exec " cmd)]`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Jepsen: Automatically restart Mesos Processes
> ---------------------------------------------
>
>                 Key: FLINK-10063
>                 URL: https://issues.apache.org/jira/browse/FLINK-10063
>             Project: Flink
>          Issue Type: Bug
>          Components: Tests
>    Affects Versions: 1.6.0
>            Reporter: Gary Yao
>            Assignee: Gary Yao
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.6.1, 1.7.0
>
>
> Use a process supervisor to automatically restart Mesos processes. This is 
> needed because Mesos uses a "fail-fast" approach to error handling, e.g., the 
> Mesos master will exit when it discovers it has been partitioned away from 
> the Zookeeper quorum. Currently the some of the tests cannot pass because the 
> Mesos processes exiting.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to