Thanks to visit codestin.com
Credit goes to github.com

Skip to content

flake: data race in scaletest/reconnectingpty Test_Runner/ExpectTimeout/NoTimeout #12687

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

Closed
johnstcn opened this issue Mar 20, 2024 · 3 comments · Fixed by #15475
Closed

flake: data race in scaletest/reconnectingpty Test_Runner/ExpectTimeout/NoTimeout #12687

johnstcn opened this issue Mar 20, 2024 · 3 comments · Fixed by #15475
Assignees
Labels
bug risk Prone to bugs s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks

Comments

@johnstcn
Copy link
Member

Seen here: https://github.com/coder/coder/actions/runs/8359694931/job/22883576316

==================
WARNING: DATA RACE
Read at 0x00c01595a710 by goroutine 4398:
  os/exec.dedupEnvCase()
      /opt/hostedtoolcache/go/1.21.5/x64/src/os/exec/exec.go:1230 +0x17a
  os/exec.dedupEnv()
      /opt/hostedtoolcache/go/1.21.5/x64/src/os/exec/exec.go:1217 +0x1f9
  os/exec.(*Cmd).environ()
      /opt/hostedtoolcache/go/1.21.5/x64/src/os/exec/exec.go:1196 +0xad
  os/exec.(*Cmd).Start()
      /opt/hostedtoolcache/go/1.21.5/x64/src/os/exec/exec.go:688 +0x7d5
  os/exec.(*Cmd).Run()
      /opt/hostedtoolcache/go/1.21.5/x64/src/os/exec/exec.go:587 +0x26
  github.com/coder/coder/v2/agent/reconnectingpty.(*screenReconnectingPTY).sendCommand.func1()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:344 +0x4ce
  github.com/coder/coder/v2/agent/reconnectingpty.(*screenReconnectingPTY).sendCommand()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:366 +0x1f7
  github.com/coder/coder/v2/agent/reconnectingpty.(*screenReconnectingPTY).doAttach()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:300 +0xf04
  github.com/coder/coder/v2/agent/reconnectingpty.(*screenReconnectingPTY).Attach()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:172 +0x2f1
  github.com/coder/coder/v2/agent.(*agent).handleReconnectingPTY()
      /home/runner/actions-runner/_work/coder/coder/agent/agent.go:1467 +0x10c7
  github.com/coder/coder/v2/agent.(*agent).createTailnet.func5.2()
      /home/runner/actions-runner/_work/coder/coder/agent/agent.go:1220 +0x626

Previous write at 0x00c01595a710 by goroutine 4399:
  github.com/coder/coder/v2/agent/reconnectingpty.(*screenReconnectingPTY).sendCommand.func1()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:341 +0x336
  github.com/coder/coder/v2/agent/reconnectingpty.(*screenReconnectingPTY).sendCommand()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:366 +0x1f7
  github.com/coder/coder/v2/agent/reconnectingpty.(*screenReconnectingPTY).lifecycle()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:149 +0x2e4
  github.com/coder/coder/v2/agent/reconnectingpty.newScreen.func1()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:70 +0xcc

Goroutine 4398 (running) created at:
  github.com/coder/coder/v2/agent.(*agent).createTailnet.func5()
      /home/runner/actions-runner/_work/coder/coder/agent/agent.go:1199 +0x2e4
  github.com/coder/coder/v2/agent.(*agent).trackGoroutine.func1()
      /home/runner/actions-runner/_work/coder/coder/agent/agent.go:1126 +0x95

Goroutine 4399 (running) created at:
  github.com/coder/coder/v2/agent/reconnectingpty.newScreen()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/screen.go:70 +0x484
  github.com/coder/coder/v2/agent/reconnectingpty.New()
      /home/runner/actions-runner/_work/coder/coder/agent/reconnectingpty/reconnectingpty.go:79 +0x257
  github.com/coder/coder/v2/agent.(*agent).handleReconnectingPTY()
      /home/runner/actions-runner/_work/coder/coder/agent/agent.go:1451 +0xdc4
  github.com/coder/coder/v2/agent.(*agent).createTailnet.func5.2()
      /home/runner/actions-runner/_work/coder/coder/agent/agent.go:1220 +0x626
==================
@johnstcn johnstcn added flake s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks labels Mar 20, 2024
@coder-labeler coder-labeler bot added the bug risk Prone to bugs label Mar 20, 2024
@f0ssel
Copy link
Contributor

f0ssel commented Mar 20, 2024

@stirby
Copy link
Collaborator

stirby commented Apr 26, 2024

@johnstcn trying to clean up the backlog, feel free to re-open if pertinent.

@stirby stirby closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2024
@johnstcn johnstcn reopened this Nov 11, 2024
@johnstcn
Copy link
Member Author

@johnstcn johnstcn self-assigned this Nov 11, 2024
johnstcn added a commit that referenced this issue Nov 11, 2024
#15475)

Fixes #12687

There was a race condition where we would start the rpty lifecycle
before generating the ID, leading to a data race where we would try to
concurrently read and write the struct field.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug risk Prone to bugs s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants