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

x/net/websocket deadlock in codec.Send #16298

Closed
james-lawrence opened this issue Jul 8, 2016 · 4 comments
Closed

x/net/websocket deadlock in codec.Send #16298

james-lawrence opened this issue Jul 8, 2016 · 4 comments

Comments

@james-lawrence
Copy link
Contributor

james-lawrence commented Jul 8, 2016

  1. What version of Go are you using (go version)?
    go version go1.6 linux/amd64
  2. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/developer/.golang/lib"
GORACE=""
GOROOT="/home/developer/.golang/go"
GOTOOLDIR="/home/developer/.golang/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
  1. What did you do?
    I used the library: https://github.com/nlopes/slack
    made a RTM connection to slack, then remove authorization from within the slack api causing it to close
    the websocket.
  2. What did you expect to see?
    Send to return an error due to connection being closed.
    with a deadline the issue is resolved although the error return is a timeout vs remote closed.
    result with a write deadline set:
2016/07/08 10:03:41 websocket_managed_conn.go:232: PING invoked
2016/07/08 10:03:41 websocket_managed_conn.go:244: Invoking JSON Send
2016/07/08 10:03:41 websocket.go:291: Codec Send
2016/07/08 10:03:41 websocket.go:293: Codec Marshal Completed <nil>
2016/07/08 10:03:41 websocket.go:298: Codec Send: locking {0 0}
2016/07/08 10:03:41 websocket.go:302: Codec Send: Locked {1 0}
2016/07/08 10:03:42 websocket.go:311: Codec Send: write failure write tcp 10.0.2.15:50564->52.90.163.180:443: i/o timeout
2016/07/08 10:03:42 websocket.go:313: Codec Send: unlocked {0 0}
2016/07/08 10:03:42 websocket_managed_conn.go:247: Send Failure write tcp 10.0.2.15:50564->52.90.163.180:443: i/o timeout
2016/07/08 10:03:42 websocket_managed_conn.go:249: PING done
2016/07/08 10:03:42 hybi.go:313: handler WriteClose locking: {0 0}
2016/07/08 10:03:42 hybi.go:325: handler WriteClose unlocked: {0 0}
  1. What did you see instead?
    this is without the deadline.
2016/07/08 10:01:30 websocket_managed_conn.go:232: PING invoked
2016/07/08 10:01:30 websocket_managed_conn.go:244: Invoking JSON Send
2016/07/08 10:01:30 websocket.go:291: Codec Send
2016/07/08 10:01:30 websocket.go:293: Codec Marshal Completed <nil>
2016/07/08 10:01:30 websocket.go:298: Codec Send: locking {0 0}
2016/07/08 10:01:30 websocket.go:302: Codec Send: Locked {1 0}
@tommyp1ckles
Copy link

I tried to reproduce this using the slack module but I couldn't get anything to lock up.

Heres what I did

    api := slack.New("<my_token>")
    rtm := api.NewRTM()

Then I disabled the slack bot that the token was for and finally ran rtm.Disconnect().
Could you provide more details on how to reproduce this?

@james-lawrence
Copy link
Contributor Author

absolutely writing a minimal program that will reproduce it.

@james-lawrence
Copy link
Contributor Author

sorry for the delay, I'm having trouble reproducing it outside the application as well. I've been swamped with other priorities at work. will take another stab at figuring out the exact conditions this weekend.

@quentinmit quentinmit added this to the Unreleased milestone Jul 19, 2016
@james-lawrence
Copy link
Contributor Author

havent been able to reproduce this with minimal code, and I doubt I'll have time to revisit it.

@golang golang locked and limited conversation to collaborators May 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants