You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2018/05/29 14:05:00 UTC

[jira] [Commented] (SSHD-340) Hanging threads left working when server is shut down

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

Guillaume Nodet commented on SSHD-340:
--------------------------------------

I disagree that this is not a supported use case.  When I first wrote SSHD, the main purpose is to integrate it in an OSGi environment, where bundles can be restarted at will, so this _is_ definitely a supported use case.

Fwiw, the {{Closeable#close(true)}} has been created for the very purpose of closing a resource "brutally".  If you want a clean shutdown, one should use {{close(false)}}.
Looking at the code, I can see a few locations where this is not correctly implemented I think.  For example {{Nio2ServiceFactory}} does perform a {{group.awaitTermination}} during {{doCloseImmediately()}} which is wrong.  Such waits should be performed in the {{doCloseGracefully()}}.

This has been introduced in 1.0.0, so it could explain why reverting to 0.10 works better for that.


> Hanging threads left working when server is shut down
> -----------------------------------------------------
>
>                 Key: SSHD-340
>                 URL: https://issues.apache.org/jira/browse/SSHD-340
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 0.12.0
>            Reporter: Sampo Savolainen
>            Priority: Major
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SSHD fails to stop properly due to errant threads. I've attached a thread dump from a point of execution where everything should have been cleaned up. The hanging threads happen only if the server has accepted connections and they do not hang forever, they seem to stop themselves after a minute or so. This might be an executor pool which is not shut down correctly.
> Earlier versions (0.8.0 and 0.9.0) did not exhibit this behavior.



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