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

Latest build of go-simplejson has broken lookupd interaction #10

Merged
merged 1 commit into from
Oct 4, 2013

Conversation

mreiferson
Copy link
Member

I think the changes made here bitly/go-simplejson@7f4699f have broken my nsq client. It now panics when trying to parse nsqlookupd response. See below panic stack and json response it's trying to parse when panicking. (Admittedly it's an old version of nsqlookupd)

{
  "data": {
    "producers": [
      {
        "version": "0.2.18",
        "http_port": 4151,
        "tcp_port": 4150,
        "broadcast_address": "vpcutilities03-global01-test",
        "hostname": "vpcutilities03-global01-test",
        "address": "vpcutilities03-global01-test"
      },
      {
        "version": "0.2.18",
        "http_port": 4151,
        "tcp_port": 4150,
        "broadcast_address": "vpcutilities02-global01-test",
        "hostname": "vpcutilities02-global01-test",
        "address": "vpcutilities02-global01-test"
      },
      {
        "version": "0.2.18",
        "http_port": 4151,
        "tcp_port": 4150,
        "broadcast_address": "vpcutilities01-global01-test",
        "hostname": "vpcutilities01-global01-test",
        "address": "vpcutilities01-global01-test"
      }
    ],
    "channels": [
      "revpro.listener.johnworrell",
      "revpro.listener.hailo",
      "gamification",
      "acunuworker",
      "exp-event-augmenter-dom",
      "exp-event-augmenter"
    ]
  },
  "status_txt": "OK",
  "status_code": 200
}


panic: interface conversion: interface is json.Number, not float64

goroutine 1 [running]:
github.com/hailocab/go-nsq.(*Reader).queryLookupd(0xc2002fa000)
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-nsq/reader.go:447 +0x59d
github.com/hailocab/go-nsq.(*Reader).ConnectToLookupd(0xc2002fa000, 0xc20025e540, 0x30, 0x1, 0x1, ...)
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-nsq/reader.go:378 +0x25d
github.com/hailocab/go-service-layer/nsq.(*LookupdSubscriber).configure(0xc200258840)
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-service-layer/nsq/subscriber.go:57 +0x693
github.com/hailocab/go-service-layer/nsq.*LookupdSubscriber.(github.com/hailocab/go-service-layer/nsq.configure)·fm()
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-service-layer/nsq/subscriber.go:25 +0x24
sync.(*Once).Do(0xc200258858, 0xbc97a8)
    /opt/boxen/homebrew/Cellar/go/1.1/src/pkg/sync/once.go:40 +0x7e
github.com/hailocab/go-service-layer/nsq.(*LookupdSubscriber).AddAsyncHandler(0xc200258840, 0xc200258870, 0xc2002cf1c0)
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-service-layer/nsq/subscriber.go:36 +0x78
github.com/hailocab/go-service-layer/acunu/ingester.New(0x61acd0, 0x12, 0x5ec9b0, 0xc, 0x0, ...)
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-service-layer/acunu/ingester/ingester.go:73 +0x57d
github.com/hailocab/go-service-layer/acunu/ingester.func·001()
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-service-layer/acunu/ingester/ingester.go:90 +0x57
github.com/hailocab/go-platform-layer/server.doRun(0x0)
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-platform-layer/server/server.go:236 +0x3b0
github.com/hailocab/go-platform-layer/server.Run()
    /Users/dominic/development/goworkspace/src/github.com/hailocab/go-platform-layer/server/server.go:206 +0x20
main.main()
    /Users/dominic/development/goworkspace/src/github.com/hailocab/gamification-service/main.go:27 +0x224 

@mreiferson
Copy link
Member

Dependency hell :(. The attached commit should resolve it, if you wanna give it a whirl @domwong... we were poking into simplejson internals.

FWIW we're trying to improve the dependency situation for NSQ by trying out godep, see nsqio/nsq#266.

Beyond the scope of the actual issue, this is a perfect example of the dangers of the current state of out-of-the-box dependency management in Go.

@mreiferson
Copy link
Member

alternatively, don't pull in the latest go-simplejson :)

@domwong
Copy link
Contributor Author

domwong commented Oct 4, 2013

That's my current plan. Just thought I'd flag up the issue in case you'd not seen it.

jehiah added a commit that referenced this pull request Oct 4, 2013
Latest build of go-simplejson has broken lookupd interaction
@jehiah jehiah merged commit 70f2dce into nsqio:master Oct 4, 2013
@mreiferson
Copy link
Member

@domwong thanks for the heads up

sthulb pushed a commit to HailoOSS/go-nsq that referenced this pull request Sep 14, 2016
Use private random number generator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants