yahoo/vssh

Race condition

Closed this issue · 1 comments

Hello everyone,
there seems to be a race condition in the following places:

WARNING: DATA RACE
Read at 0x00c00130d650 by goroutine 43:
  github.com/yahoo/vssh.(*VSSH).reConnect()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/vssh.go:369 +0x128

Previous write at 0x00c00130d650 by goroutine 280:
  github.com/yahoo/vssh.(*clientAttr).setErr()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/client.go:314 +0x564
  github.com/yahoo/vssh.(*clientAttr).connect()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/client.go:366 +0x42d
  github.com/yahoo/vssh.(*connect).run()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/client.go:403 +0x228
  github.com/yahoo/vssh.(*VSSH).process.func1()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/vssh.go:223 +0x20e

Goroutine 43 (running) created at:
  github.com/yahoo/vssh.(*VSSH).Start()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/vssh.go:193 +0xbc

Goroutine 280 (running) created at:
  github.com/yahoo/vssh.(*VSSH).process()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/vssh.go:216 +0x64
==================
==================
WARNING: DATA RACE
Read at 0x00c00130d648 by goroutine 43:
  github.com/yahoo/vssh.(*VSSH).reConnect()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/vssh.go:369 +0x32c

Previous write at 0x00c00130d648 by goroutine 280:
  github.com/yahoo/vssh.(*clientAttr).setErr()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/client.go:311 +0x472
  github.com/yahoo/vssh.(*clientAttr).connect()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/client.go:366 +0x42d
  github.com/yahoo/vssh.(*connect).run()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/client.go:403 +0x228
  github.com/yahoo/vssh.(*VSSH).process.func1()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/vssh.go:223 +0x20e

Goroutine 43 (running) created at:
  github.com/yahoo/vssh.(*VSSH).Start()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/vssh.go:193 +0xbc


Goroutine 280 (running) created at:
  github.com/yahoo/vssh.(*VSSH).process()
      go/pkg/mod/github.com/yahoo/vssh@v0.0.0-20200730163636-1a184d5b1d77/vssh.go:216 +0x64

Thanks Dawid! @dawidpogorzelski
Please check and let me know if you're still seeing any race conditions!