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

Fix a data race between Cmd.Run and Process.Kill #31

Merged
merged 2 commits into from
Jun 22, 2017
Merged

Fix a data race between Cmd.Run and Process.Kill #31

merged 2 commits into from
Jun 22, 2017

Conversation

IngmarStein
Copy link
Contributor

Replacing Cmd.Run with Cmd.Start + Cmd.Wait fixes the following data race:

==================
WARNING: DATA RACE
Read at 0x00c420062e60 by main goroutine:
  main.closeHooksServers()
      github.com/snikch/goodman/cmd/goodman/main.go:89 +0xd9
  main.main()
      github.com/snikch/goodman/cmd/goodman/main.go:82 +0xb56

Previous write at 0x00c420062e60 by goroutine 10:
  os/exec.(*Cmd).Start()
      /usr/local/go/src/os/exec/exec.go:354 +0x78c
  os/exec.(*Cmd).Run()
      /usr/local/go/src/os/exec/exec.go:277 +0x3c
  main.main.func2()
      github.com/snikch/goodman/cmd/goodman/main.go:50 +0x70

Goroutine 10 (running) created at:
  main.main()
      github.com/snikch/goodman/cmd/goodman/main.go:54 +0x6cc
==================

@ddelnano
Copy link
Collaborator

👍🏻 this should have been turned on before. Thanks for the fix!

@ddelnano ddelnano merged commit 3b65f3e into snikch:master Jun 22, 2017
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

Successfully merging this pull request may close these issues.

2 participants