Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: Node, Windows

      Description

      There is a problem when the "integration tests" are attempting to stop flume on Windows using Process.destroy(). This does a brute force kill of the top level shell (running the startup script) which then leaves a child java process (i.e flume agent) running.

      The brute force kill does not allow the shell to terminate the child java process. Maven somehow notices that child processes are running and waits indefinitely for them to terminate... causing a hang.

      Suggestion is to implement a shutdown command support using JMX. This gives the integration tests a graceful mechanism to terminate flume. Also in production use cases this mechanism can be secured with authentication etc.

        Activity

        Hide
        roshan_naik Roshan Naik added a comment -

        It is not clear to me how the problem would go away. the service would still need a way to start/stop flume java process cleanly. also does not seem feasible to solve the unit testing issues.

        Show
        roshan_naik Roshan Naik added a comment - It is not clear to me how the problem would go away. the service would still need a way to start/stop flume java process cleanly. also does not seem feasible to solve the unit testing issues.
        Hide
        bmahe Bruno Mahé added a comment -

        Thanks Roshan!
        So instead of implementing JMX shutdown, why not completing FLUME-1336? It would kill 2 birds with one stone.

        Show
        bmahe Bruno Mahé added a comment - Thanks Roshan! So instead of implementing JMX shutdown, why not completing FLUME-1336 ? It would kill 2 birds with one stone.
        Hide
        hshreedharan Hari Shreedharan added a comment -

        Roshan Naik - You can connect to local JMX (for Flume's metrics) from the local machine without any special config. Only remote JMX needs to be specifically enabled.

        Show
        hshreedharan Hari Shreedharan added a comment - Roshan Naik - You can connect to local JMX (for Flume's metrics) from the local machine without any special config. Only remote JMX needs to be specifically enabled.
        Hide
        roshan_naik Roshan Naik added a comment -

        Bruno Mahé FLUME-1336 has an unfinished patch for windows service creation.. i recall it was nearly there but needed a few tweaks.

        Show
        roshan_naik Roshan Naik added a comment - Bruno Mahé FLUME-1336 has an unfinished patch for windows service creation.. i recall it was nearly there but needed a few tweaks.
        Hide
        bmahe Bruno Mahé added a comment -

        Naive question: does Apache Flume have service scripts on Windows?

        Show
        bmahe Bruno Mahé added a comment - Naive question: does Apache Flume have service scripts on Windows?
        Hide
        roshan_naik Roshan Naik added a comment -

        Correct me if I am wrong but I don't believe JMX is enabled by default and needs JAVA_OPTS to be set if users intend to enable it. Consequently it would be enabled on a need basis.

        The problem that i was referring to is noted in the JIRA description

        Show
        roshan_naik Roshan Naik added a comment - Correct me if I am wrong but I don't believe JMX is enabled by default and needs JAVA_OPTS to be set if users intend to enable it. Consequently it would be enabled on a need basis. The problem that i was referring to is noted in the JIRA description
        Hide
        hshreedharan Hari Shreedharan added a comment -

        Anyone with access to the machine can kill the process now. The reason I don;t think the user should set up JMX security is that until now there was no need to, and now we are adding additional operation overhead.

        I don't really know why this needs to be solved. Just killing the process should be good enough - we don't need to provide a kill switch. If we really need an alternate solution, it must be by providing an admin interface, which is secure etc - which is a pretty large project in itself.

        Show
        hshreedharan Hari Shreedharan added a comment - Anyone with access to the machine can kill the process now. The reason I don;t think the user should set up JMX security is that until now there was no need to, and now we are adding additional operation overhead. I don't really know why this needs to be solved. Just killing the process should be good enough - we don't need to provide a kill switch. If we really need an alternate solution, it must be by providing an admin interface, which is secure etc - which is a pretty large project in itself.
        Hide
        roshan_naik Roshan Naik added a comment -
        • Could you elaborate on the stated concerns with JMX & security ?
        • Do you have an alternative in mind to solve this problem ?
        Show
        roshan_naik Roshan Naik added a comment - Could you elaborate on the stated concerns with JMX & security ? Do you have an alternative in mind to solve this problem ?
        Hide
        hshreedharan Hari Shreedharan added a comment -

        This patch seems to be a diff patch with some previously uncommitted code (there is code that is being removed that is not in trunk like the @Author tag). Also without having a secure mechanism (and not relying on the user to use JMX security), I don't feel comfortable with doing this.

        Show
        hshreedharan Hari Shreedharan added a comment - This patch seems to be a diff patch with some previously uncommitted code (there is code that is being removed that is not in trunk like the @Author tag). Also without having a secure mechanism (and not relying on the user to use JMX security), I don't feel comfortable with doing this.
        Hide
        roshan_naik Roshan Naik added a comment -

        No its waiting on a committer to review and commit this patch. Since i authored it, i didn't commit it.

        Show
        roshan_naik Roshan Naik added a comment - No its waiting on a committer to review and commit this patch. Since i authored it, i didn't commit it.
        Hide
        paliwalashish Ashish Paliwal added a comment -

        Roshan Naik Is this patch integrated? Can we mark it as resolved?

        Show
        paliwalashish Ashish Paliwal added a comment - Roshan Naik Is this patch integrated? Can we mark it as resolved?
        Hide
        roshan_naik Roshan Naik added a comment -

        Integration tests now use JMX shutdown command instead of Process.destroy() to terminate flume.

        Solves the problem of maven hanging on windows when running integration tests.

        Verfied it works correctly on linux also.

        Show
        roshan_naik Roshan Naik added a comment - Integration tests now use JMX shutdown command instead of Process.destroy() to terminate flume. Solves the problem of maven hanging on windows when running integration tests. Verfied it works correctly on linux also.

          People

          • Assignee:
            roshan_naik Roshan Naik
            Reporter:
            roshan_naik Roshan Naik
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:

              Development