mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goldstein Lyor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SSHD-911) Deadlock in Apache SshClient used for local port forwarding
Date Tue, 30 Apr 2019 05:13:00 GMT

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

Goldstein Lyor commented on SSHD-911:
-------------------------------------

I am a bit confused - in the new deadlock you report it seems to revolve only around the {{encodeLock}}
so I don't see how a deadlock can occur. On the other hand, you mention {{AbstractCloseable#lock}}
as the participant in the deadlock. I am therefore not sure who is locking what and why is
it causing a deadlock.

Nevertheless, I took a closer look at the  {{AbstractCloseable#lock}} and it seems that code
rather "abuses" it. However, figuring out where is it really needed and where it isn't is
quite an upheaval, so I have opened a *separate* issue for it (SSHD-912). 

That being said, the only way I can figure out a deadlock between the  {{encodeLock}} and
the {{AbstractCloseable#lock}}  is if thread A somehow lock {{AbstractCloseable#lock}} and
tries to write a packet (which seems a possible scenario) while thread B tries to lock {{AbstractCloseable#lock}}
while already holding {{encodeLock}} - which my current code analysis does not seem to indicate
is possible (but I'll keep looking).

> Deadlock in Apache SshClient used for local port forwarding
> -----------------------------------------------------------
>
>                 Key: SSHD-911
>                 URL: https://issues.apache.org/jira/browse/SSHD-911
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.2.0
>            Reporter: Roberto Deandrea
>            Assignee: Goldstein Lyor
>            Priority: Major
>         Attachments: spxp.usrdump.20382184@AIX72.DMZ.20190417205240026.log, spxp.usrdump.33095980@AIX72.DMZ.20190423123751496.log
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hi Lyor,
> We have an Apache SSHD 2.2.0 client and server SSH pair used for local port forwarding
of different protocols.
> In our lab environment we found that sometimes when the SSH client for any reason is
disconnecting from the SSH server, a DEADLOCK happens on the sshClient regarding the threads
in the thread pool.
> We are using builtin nio2 implementation for our SshClient.
> The deadlock is regarding the ClientChannelPendingMessagesQueue class added to fix routing
problems for local port forwarding in the past.
> Attached you can find the thread dump taken after the deadlock happend.
>  
> Can you please troubleshoot this problem ?
> [^spxp.usrdump.20382184@AIX72.DMZ.20190417205240026.log]



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

Mime
View raw message