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

Race conditions in message sending #7

Open
technosophos opened this issue Jul 2, 2014 · 2 comments
Open

Race conditions in message sending #7

technosophos opened this issue Jul 2, 2014 · 2 comments

Comments

@technosophos
Copy link
Contributor

Running a Go app with go run -race is showing me a few race conditions when sending messages.

==================
WARNING: DATA RACE
Write by goroutine 14:
  github.com/pubnub/go/messaging.func·001()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:1978 +0x36e
  net/http.(*Transport).dial()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:442 +0xcc
  net/http.(*Transport).dialConn()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:496 +0xab
  net/http.func·018()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:472 +0x8c

Previous write by goroutine 17:
  github.com/pubnub/go/messaging.func·001()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:1978 +0x36e
  net/http.(*Transport).dial()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:442 +0xcc
  net/http.(*Transport).dialConn()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:496 +0xab
  net/http.func·018()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:472 +0x8c

Goroutine 14 (running) created at:
  net/http.(*Transport).getConn()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:474 +0x347
  net/http.(*Transport).RoundTrip()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:201 +0x584
  net/http.send()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/client.go:195 +0x62d
  net/http.(*Client).send()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/client.go:118 +0x200
  net/http.(*Client).doFollowingRedirects()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/client.go:343 +0xd31
  net/http.(*Client).Do()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/client.go:150 +0xc2
  github.com/pubnub/go/messaging.connect()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:2056 +0x154
  github.com/pubnub/go/messaging.(*Pubnub).httpRequest()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:1936 +0xe7
  github.com/pubnub/go/messaging.(*Pubnub).sendPublishRequest()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:590 +0x430
  github.com/pubnub/go/messaging.(*Pubnub).Publish()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:733 +0xddc

Goroutine 17 (running) created at:
  net/http.(*Transport).getConn()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:474 +0x347
  net/http.(*Transport).RoundTrip()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/transport.go:201 +0x584
  net/http.send()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/client.go:195 +0x62d
  net/http.(*Client).send()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/client.go:118 +0x200
  net/http.(*Client).doFollowingRedirects()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/client.go:343 +0xd31
  net/http.(*Client).Do()
      /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/client.go:150 +0xc2
  github.com/pubnub/go/messaging.connect()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:2056 +0x154
  github.com/pubnub/go/messaging.(*Pubnub).httpRequest()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:1936 +0xe7
  github.com/pubnub/go/messaging.(*Pubnub).sendPublishRequest()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:590 +0x430
  github.com/pubnub/go/messaging.(*Pubnub).Publish()
      /Users/mbutcher/Code/sugarmill/.godeps/src/github.com/pubnub/go/messaging/pubnub.go:733 +0xddc
==================
@geremyCohen
Copy link
Contributor

Checking...

@crimsonred
Copy link
Contributor

@technosophos , thanks for notifying us about the issue. The data races have been fixed in the new version.

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

No branches or pull requests

3 participants