You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Damien Katz (JIRA)" <ji...@apache.org> on 2009/05/30 20:04:07 UTC

[jira] Created: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
-------------------------------------------------------------------------------------------

                 Key: COUCHDB-370
                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
             Project: CouchDB
          Issue Type: Bug
    Affects Versions: 0.9
            Reporter: Damien Katz
            Priority: Minor


If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738697#action_12738697 ] 

Paul Joseph Davis commented on COUCHDB-370:
-------------------------------------------

Is it possible to make couchspawnkillable watch for the parent process death without introducing a new process into the mix? The *nix variant is a simple shell script that exec's and I'd be a tad remiss to make it more complicated. It also seems awfully recursive otherwise. Not to mention that we'd be doubling the number of OS level processes used.

My vote would still be for using heart if possible.

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Adam Kocoloski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738079#action_12738079 ] 

Adam Kocoloski commented on COUCHDB-370:
----------------------------------------

Hi Mark, I think couchspawnkillable was supposed the solution to this ticket.

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738471#action_12738471 ] 

Paul Joseph Davis commented on COUCHDB-370:
-------------------------------------------

Is this something we can hook into heart to look at the process tree between restarts?

[1] http://steve.vinoski.net/blog/2009/02/22/controlling-erlangs-heart/

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738677#action_12738677 ] 

Mark Hammond commented on COUCHDB-370:
--------------------------------------

Damien writes:
> A correct solution is one or more watchdog processes that watch the 
> VM and the subprocess, and if the VM dies, it kills all the subprocesses and then itself.

Exactly.  I was proposing couch_spawn_killable could serve the role of that watchdog - it can watch for its parent terminating, then terminate its child and then itself.  Although this isn't a *single* watchdog, it should have the same end result.

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Damien Katz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738390#action_12738390 ] 

Damien Katz commented on COUCHDB-370:
-------------------------------------

While I agree we should prevent unnecessary VM exits, we can't prevent them all and fortunately the VM is designed to terminate and restart quickly. This is part of CouchDB's design too, restarts are always fast.

A correct solution is one or more watchdog processes that watch the VM and the subprocess, and if the VM dies, it kills all the subprocesses and then itself.

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Damien Katz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damien Katz updated COUCHDB-370:
--------------------------------

    Component/s: JavaScript View Server
    Description: If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.  (was: If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process that kill the subprocess automatically if the CouchDB erlang vm dies.)

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis updated COUCHDB-370:
--------------------------------------

    Skill Level: Regular Contributors Level (Easy to Medium)

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Adam Kocoloski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738340#action_12738340 ] 

Adam Kocoloski commented on COUCHDB-370:
----------------------------------------

Hi Mark, my take on the code in couch_os_process is that if the couch_os_process gen_server dies for any reason, another process which has been monitoring that gen_server swoops in and executes a kill -9 on the OS process.  This approach doesn't rely on stdin being read by the child proc.

I could see a sudden Erlang VM death leading to an OS process being orphaned.  If that's happening I think we should focus our efforts on preventing the VM death :-), but if it's simple to do then having couchspawnkillable monitor the VM is also a good idea.

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737848#action_12737848 ] 

Mark Hammond commented on COUCHDB-370:
--------------------------------------

An option may be to upgrade couch_spawn_killable to detect its parent dieing and kill its child?

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-370) If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed

Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738141#action_12738141 ] 

Mark Hammond commented on COUCHDB-370:
--------------------------------------

If I understand correctly, couchspawnkillable will terminate couch's children when couch explicitly asks, but should couch go away silently and suddenly these children may continue to exist.  While couch stopping would *usually* kill the child due to the child's stdin being closed, this would not be the case if the child process was in an infinite loop and didn't get back to trying to read stdin.

> If the CouchDB vm is dies or is killed, view subprocesses (js) are not automatically killed
> -------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-370
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-370
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.9
>            Reporter: Damien Katz
>            Priority: Minor
>
> If CouchDB dies or is killed, it's subprocess are not forcefully killed. If the subprocesses are in infinite loops, they will never die. We need some kind of external watchdog process, or processes that kill the subprocess automatically if the CouchDB erlang vm dies.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.