[
https://issues.apache.org/jira/browse/CLOUDSTACK-8611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614576#comment-14614576
]
ASF GitHub Bot commented on CLOUDSTACK-8611:
--------------------------------------------
GitHub user likitha opened a pull request:
https://github.com/apache/cloudstack/pull/561
CLOUDSTACK-8611. CS waits indefinitely for CheckS2SVpnConnectionsComm…
…and to return.
While remote executing commands through ssh, handle channel condition of
EOF because we wait for the the condition.
CheckS2SVpnConnectionsCommand execution involves executing a script
(checkbatchs2svpn.sh) in the virtual router. Once CS has opened a session to a
virtual router and executed a script in the router, it waits indefinitely till
the session either times-out or the exit status of the remote process is
available. But it is possible that an EOF is reached by the process in the
router and the router never set the exit status.
References -
1. Some servers never send the exist status, or occasionally "forget" to do
so
(http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson/trilead-ssh2/build212-hudson-1/com/trilead/ssh2/ChannelCondition.java).
2. Get the exit code/status from the remote command - if available. Be
careful - not all server implementations return this value -
(http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson/trilead-ssh2/build212-hudson-1/com/trilead/ssh2/Session.java#Session.waitForCondition%28int%2Clong%29).
Hence if exit status is not set then the command will never return.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/likitha/cloudstack CLOUDSTACK-8611
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cloudstack/pull/561.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 #561
----
commit b9181c689e0e7b5f1e28c81d73710196dfabd0ba
Author: Likitha Shetty <[email protected]>
Date: 2015-05-01T11:14:51Z
CLOUDSTACK-8611. CS waits indefinitely for CheckS2SVpnConnectionsCommand to
return.
While remote executing commands through ssh, handle channel condition of
EOF because we wait for the the condition.
----
> CS waits indefinitely for CheckS2SVpnConnectionsCommand to return
> -----------------------------------------------------------------
>
> Key: CLOUDSTACK-8611
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8611
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Reporter: Likitha Shetty
> Assignee: Likitha Shetty
> Fix For: 4.6.0
>
>
> On one instance, CS began to execute CheckS2SVpnConnectionsCommand command on
> a router but the command result was never returned to the MS. If a command
> never returns, then 'DirectAgent' thread executing this command is blocked
> indefinitely and cannot pick up any other request.
> Now since this command is designed to execute in sequence on a host and is
> run regularly, every execution of that command thereafter on that particular
> host ended up picking up a DirectAgent thread and waiting for the previous
> execution to complete. And hence overtime, the host ended up using and
> blocking all 'DirectAgent' threads indefinitely.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)