You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/15 18:08:20 UTC

[jira] [Commented] (FLINK-4625) Guard Flink processes against blocking shutdown hooks

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

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

GitHub user StephanEwen opened a pull request:

    https://github.com/apache/flink/pull/2503

    [FLINK-4625] [core] Add a safety net to forcibly terminate JVM if clean shutdown freezed.

    Resource managers like YARN send the JVM the `SIGTERM` signal to kill the process.
    
    With `SIGTERM`, the JVM shutdown hooks run, and may cause the process to freeze up during shutdown. Especially since all dependencies (like Hadoop) may install shutdown hooks (and do so), it is not in Flink's control to make sure all shutdown hooks are well behaved and never lock the JVM shutdown.
    
    This pull requests adds a shutdown hook that calls `Runtime.halt()` after a delay. This forcibly terminates the JVM if clean shutdown does not succeed within a certain time (default is five seconds).
    
    The pull request also adds tests that validate the behavior of JVM shutdown lockups and that the safety net ensures the process really shuts down.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/StephanEwen/incubator-flink process_self_kill

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/2503.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2503
    
----
commit d5b9860773ec7aaf0b238544b794a10012d8dda5
Author: Stephan Ewen <se...@apache.org>
Date:   2016-09-15T17:27:06Z

    [FLINK-4625] [core] Add a safety net to forcibly terminate JVM is clean shutdown freezed.

----


> Guard Flink processes against blocking shutdown hooks
> -----------------------------------------------------
>
>                 Key: FLINK-4625
>                 URL: https://issues.apache.org/jira/browse/FLINK-4625
>             Project: Flink
>          Issue Type: Improvement
>          Components: Distributed Coordination
>    Affects Versions: 1.1.2
>            Reporter: Stephan Ewen
>            Assignee: Stephan Ewen
>             Fix For: 1.2.0
>
>
> Resource managers like YARN send the JVM the {{SIGTERM}} signal to kill the process, if it wants to terminate a process.
> With {{SIGTERM}}, the JVM shutdown hooks run, and may cause the process to freeze up on shutdown. Especially since all dependencies (like Hadoop) may install shutdown hooks (and do so), it is not in Flink's control to make sure all Shutdown hooks are well behaved.
> I propose to add a guard that forcibly terminates the JVM if clean shutdown does not succeed within a certain time (say five seconds).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)