Skip to content

Conversation

@likitha
Copy link

@likitha likitha commented Jul 6, 2015

…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.

…and to return.

While remote executing commands through ssh, handle channel condition of EOF because we wait for the the condition.
@asfbot
Copy link

asfbot commented Jul 6, 2015

cloudstack-pull-requests #689 SUCCESS
This pull request looks good

@remibergsma
Copy link
Contributor

Who wants to step in and finish this work? It seems the original author is not able to finish it. If no one steps in, we'll have to close the PR without merging it so please help :-).

remibergsma added a commit to remibergsma/cloudstack that referenced this pull request Aug 17, 2015
This closes apache#577
This closes apache#566
This closes apache#562
This closes apache#561
This closes apache#556
This closes apache#555
This closes apache#554
This closes apache#548
This closes apache#544
This closes apache#540
This closes apache#508
This closes apache#384
This closes apache#372
remibergsma added a commit to remibergsma/cloudstack that referenced this pull request Aug 17, 2015
This closes apache#577
This closes apache#566
This closes apache#562
This closes apache#561
This closes apache#556
This closes apache#555
This closes apache#554
This closes apache#548
This closes apache#544
This closes apache#540
This closes apache#384
This closes apache#372
remibergsma added a commit to remibergsma/cloudstack that referenced this pull request Aug 17, 2015
This closes apache#577
This closes apache#566
This closes apache#562
This closes apache#561
This closes apache#556
This closes apache#555
This closes apache#554
This closes apache#548
This closes apache#544
This closes apache#540
This closes apache#384
This closes apache#372
@GabrielBrascher
Copy link
Member

Shouldn't the class throw a less generic Exception? A good choice might be the com.cloud.utils.ssh.SshException.SshException(String).
Although this change is out of this PR scope, this got my attention.

@DaanHoogland
Copy link
Contributor

@GabrielBrascher If you want to work on this I suggest you pull in the pr branch and push it to your own clone to make a new PR. @likitha has left the community

@GabrielBrascher
Copy link
Member

That's fair enough @DaanHoogland, I will see what I can do for this PR.

GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 1, 2016
Continuing the work started by https://github.com/likitha cherry-pigking
commit (b9181c6) from PR
apache#561.

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.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 1, 2016
Cherry-picked the work started by https://github.com/likitha
commit (b9181c6) from PR
apache#561.

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.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 4, 2016
Cherry-picked the work started by https://github.com/likitha
commit (b9181c6) from PR
apache#561.

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.

The SshHelper of the cherry picked commit is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, this commit brings that file changes, which at most were not made
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 4, 2016
Cherry-picked the work started by https://github.com/likitha
commit (b9181c6) from PR
apache#561.

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.

The SshHelper of the cherry picked commit is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, this commit brings that file changes, which at most were not made
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 5, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 7, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 7, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 7, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 7, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 8, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 8, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 9, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
GabrielBrascher pushed a commit to GabrielBrascher/cloudstack that referenced this pull request Apr 20, 2016
Continued the work started by https://github.com/likitha
commit (b9181c6) from PR apache#561.

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.

The SshHelper of the PR apache#561 is of another path from the
current master, its path was
https://github.com/likitha/cloudstack/commits/CLOUDSTACK-8611/utils/src/com/cloud/utils/ssh/SshHelper.java;
thus, although this commit brings changes from PR apache#561, I did not
cherry-picked to keep the master file, otherwise it would look that I
had changed all the file.
by me.
@asfgit asfgit closed this in d518b61 Apr 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants