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

Data race in rule_applicator.go #487

Closed
rspurgeon opened this issue Apr 18, 2024 · 4 comments
Closed

Data race in rule_applicator.go #487

rspurgeon opened this issue Apr 18, 2024 · 4 comments

Comments

@rspurgeon
Copy link

rspurgeon commented Apr 18, 2024

When using vacuum (github.com/daveshanley/vacuum v0.9.14) in a integration test library, we receive the following DATA RACE errors.

=== RUN   Test_LintPlain
=== RUN   Test_LintPlain/lint_plain
==================
WARNING: DATA RACE
Read at 0x00c000558630 by goroutine 51:
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet.func7()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/daveshanley/vacuum@v0.9.14/motor/rule_applicator.go:597 +0x274
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet.gowrap1()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/daveshanley/vacuum@v0.9.14/motor/rule_applicator.go:615 +0x54

Previous write at 0x00c000558630 by goroutine 52:
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet.func7()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/daveshanley/vacuum@v0.9.14/motor/rule_applicator.go:598 +0x28c
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet.gowrap1()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/daveshanley/vacuum@v0.9.14/motor/rule_applicator.go:615 +0x54

Goroutine 51 (running) created at:
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/daveshanley/vacuum@v0.9.14/motor/rule_applicator.go:566 +0x5d8c
  github.com/kong/deck/cmd.executeLint()
      /Users/rick.spurgeon@konghq.com/go/src/github.com/Kong/deck/cmd/file_lint.go:113 +0x214
  github.com/spf13/cobra.(*Command).execute()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0xbc4
  github.com/spf13/cobra.(*Command).ExecuteC()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x4b8
  github.com/spf13/cobra.(*Command).Execute()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039 +0x204
  github.com/spf13/cobra.(*Command).ExecuteContext()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1032 +0x200
  github.com/kong/deck/tests/integration.lint()
      /Users/rick.spurgeon@konghq.com/go/src/github.com/Kong/deck/tests/integration/test_utils.go:338 +0x1c4
  github.com/kong/deck/tests/integration.Test_LintPlain.func1()
      /Users/rick.spurgeon@konghq.com/go/src/github.com/Kong/deck/tests/integration/lint_test.go:31 +0xd4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.22.2/libexec/src/testing/testing.go:1689 +0x180
  testing.(*T).Run.gowrap1()
      /opt/homebrew/Cellar/go/1.22.2/libexec/src/testing/testing.go:1742 +0x40

Goroutine 52 (running) created at:
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/daveshanley/vacuum@v0.9.14/motor/rule_applicator.go:566 +0x5d8c
  github.com/kong/deck/cmd.executeLint()
      /Users/rick.spurgeon@konghq.com/go/src/github.com/Kong/deck/cmd/file_lint.go:113 +0x214
  github.com/spf13/cobra.(*Command).execute()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0xbc4
  github.com/spf13/cobra.(*Command).ExecuteC()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x4b8
  github.com/spf13/cobra.(*Command).Execute()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039 +0x204
  github.com/spf13/cobra.(*Command).ExecuteContext()
      /Users/rick.spurgeon@konghq.com/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1032 +0x200
  github.com/kong/deck/tests/integration.lint()
      /Users/rick.spurgeon@konghq.com/go/src/github.com/Kong/deck/tests/integration/test_utils.go:338 +0x1c4
  github.com/kong/deck/tests/integration.Test_LintPlain.func1()
      /Users/rick.spurgeon@konghq.com/go/src/github.com/Kong/deck/tests/integration/lint_test.go:31 +0xd4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.22.2/libexec/src/testing/testing.go:1689 +0x180
  testing.(*T).Run.gowrap1()
      /opt/homebrew/Cellar/go/1.22.2/libexec/src/testing/testing.go:1742 +0x40
==================
    testing.go:1398: race detected during execution of test
--- FAIL: Test_LintPlain (0.02s)
    --- FAIL: Test_LintPlain/lint_plain (0.02s)
FAIL
FAIL    github.com/kong/deck/tests/integration  0.894s
FAIL

Looking for any tips or resolution. Thank you

@daveshanley
Copy link
Owner

strange, will look into it for you - I don't know what the issue is at the moment.

@daveshanley
Copy link
Owner

There are a few different cases causing this, should be fixed in the next release.

daveshanley added a commit that referenced this issue Apr 21, 2024
needed some locks
@daveshanley daveshanley mentioned this issue Apr 21, 2024
daveshanley added a commit that referenced this issue Apr 21, 2024
needed some locks
@daveshanley
Copy link
Owner

This has been resolved in v0.9.15

@rspurgeon
Copy link
Author

Thank you @daveshanley ! I will upgrade and report any issues. Very appreciated.

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

No branches or pull requests

2 participants