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

klient: fix client deadlock on session failure #177

Merged
merged 3 commits into from
Aug 2, 2016

Conversation

rjeczalik
Copy link
Member

When underlying streaming transport (session) was unexpectedly
closed, client hangs when no timeout was set.

We should instead expect underlying transport to fail and forward
the error to the caller instead, so it does not hang, no matter
whether timeout was used or not.

@rjeczalik rjeczalik added the wip label Aug 2, 2016
@rjeczalik rjeczalik force-pushed the send-error branch 3 times, most recently from 4b41baa to adbeef4 Compare August 2, 2016 14:09
When underlying streaming transport (session) was unexpectedly
closed, client hangs when no timeout was set.

We should instead expect underlying transport to fail and forward
the error to the caller instead, so it does not hang, no matter
whether timeout was used or not.
When session is not yet opened then open=false,closed=false,
when session is closed then open=false,closed=true.

Check first whether session is closed, so proper error
is returned.
if x.isClosed() {
return ErrSessionClosed
}

if !x.isOpened() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related with this PR:

grammatically it should be isOpen() since it is adjective

@cihangir cihangir merged commit 9f741e1 into koding:master Aug 2, 2016
@rjeczalik rjeczalik deleted the send-error branch August 2, 2016 16:23
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

2 participants