db: data race in database session management #284

Closed
fsouza opened this Issue Jan 22, 2013 · 1 comment

Comments

Projects
None yet
1 participant
Contributor

fsouza commented Jan 22, 2013

Looks like I really messed up with the new db package :-(

==================
WARNING: DATA RACE
Write by goroutine 0:
  github.com/globocom/tsuru/db.Open()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/db/storage.go:69 +0x187
  github.com/globocom/tsuru/db.Conn()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/db/storage.go:94 +0x2ba
  github.com/globocom/tsuru/app.(*App).Get()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/app/app.go:80 +0x29
  main.update()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/collector.go:48 +0x299
  main.jujuCollect()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:27 +0x1c9
  main.main()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:77 +0x713
  runtime.main()
      /var/lib/jenkins/go/src/pkg/runtime/proc.c:248 +0x91

Previous write by goroutine 41:
  github.com/globocom/tsuru/db.Open()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/db/storage.go:69 +0x187
  github.com/globocom/tsuru/db.Conn()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/db/storage.go:94 +0x2ba
  github.com/globocom/tsuru/provision/juju.(*JujuProvisioner).unitsCollection()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/provision/juju/provisioner.go:60 +0x107
  github.com/globocom/tsuru/provision/juju.(*JujuProvisioner).heal()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/provision/juju/provisioner.go:323 +0x7c
  schedunlock()
      /var/lib/jenkins/go/src/pkg/runtime/proc.c:273 +0x5f
  labix.org/v2/mgo.addBSON()
      /var/lib/jenkins/.go/src/labix.org/v2/mgo/socket.go:524 +0x2f0

Goroutine 41 (running) created at:
  github.com/globocom/tsuru/provision/juju.(*JujuProvisioner).CollectStatus()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/provision/juju/provisioner.go:362 +0x109
  main.jujuCollect()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:23 +0xb5
  main.main()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:77 +0x713
  runtime.main()
      /var/lib/jenkins/go/src/pkg/runtime/proc.c:248 +0x91

==================
==================
WARNING: DATA RACE
Write by goroutine 0:
  github.com/globocom/tsuru/db.Open()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/db/storage.go:69 +0x19f
  github.com/globocom/tsuru/db.Conn()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/db/storage.go:94 +0x2ba
  github.com/globocom/tsuru/app.(*App).Get()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/app/app.go:80 +0x29
  main.update()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/collector.go:48 +0x299
  main.jujuCollect()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:27 +0x1c9
  main.main()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:77 +0x713
  runtime.main()
      /var/lib/jenkins/go/src/pkg/runtime/proc.c:248 +0x91

Previous write by goroutine 41:
  [failed to restore the stack]

Goroutine 41 (running) created at:
  github.com/globocom/tsuru/provision/juju.(*JujuProvisioner).CollectStatus()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/provision/juju/provisioner.go:362 +0x109
  main.jujuCollect()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:23 +0xb5
  main.main()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:77 +0x713
  runtime.main()
      /var/lib/jenkins/go/src/pkg/runtime/proc.c:248 +0x91

==================
==================
WARNING: DATA RACE
Write by goroutine 0:
  github.com/globocom/tsuru/db.Open()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/db/storage.go:69 +0x1b7
  github.com/globocom/tsuru/db.Conn()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/db/storage.go:94 +0x2ba
  github.com/globocom/tsuru/app.(*App).Get()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/app/app.go:80 +0x29
  main.update()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/collector.go:48 +0x299
  main.jujuCollect()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:27 +0x1c9
  main.main()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:77 +0x713
  runtime.main()
      /var/lib/jenkins/go/src/pkg/runtime/proc.c:248 +0x91

Previous write by goroutine 41:
  [failed to restore the stack]

Goroutine 41 (running) created at:
  github.com/globocom/tsuru/provision/juju.(*JujuProvisioner).CollectStatus()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/src/github.com/globocom/tsuru/provision/juju/provisioner.go:362 +0x109
  main.jujuCollect()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:23 +0xb5
  main.main()
      /var/lib/jenkins/jobs/tsuru-deploy/workspace/collector/main.go:77 +0x713
  runtime.main()
      /var/lib/jenkins/go/src/pkg/runtime/proc.c:248 +0x91

==================
Contributor

fsouza commented Jan 22, 2013

Just to be clear, there are two data races in the report, but they're related.

@ghost ghost assigned fsouza Jan 22, 2013

@fsouza fsouza closed this in d2032ba Jan 22, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment