Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add timeout for keepalive reply #442

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ximiximi1
Copy link

The sshConn.Send Request will send message and block wait the reply.
The keepalive will not work in some special condition. For example, when the server use memory snapshot to hibernate and did not close the socket normally and there is a websocket middware like Cloudflare to proxy the websocket, when the server hibernate with memory snapshot, Cloudflare will not close the websocket connection during a very long time(this maybe a issue of Cloudflare), in the mean while, the keepalive block wait the reply(there will not have a reply as server hibernated), as a result, the ssh connection will not close until the Cloudflare close the websocket(very long time above 10min).
So I add a reply timeout for the keepalive. A timeout error will raise when wait the keepalive reply too long, and then close the ssh connetion.

@jpillora
Copy link
Owner

Thanks this is a good change - will try get a sec to test it soon

@linus-gates
Copy link

Hey, Is this going to merge anytime soon? Thanks!!

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.

None yet

3 participants