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: do not override node lookup timeout concurrently #618

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

czeslavo
Copy link

@czeslavo czeslavo commented Feb 7, 2025

In 6455a5b, NodeLookupTimeout was added to the ruleContext, but setting its default value was added to a function that is run for every rule from RuleSet.Rules concurrently, causing a data race. This fixes that by moving setting the default outside of the concurrent code.

==================
WARNING: DATA RACE
Read at 0x00c000716728 by goroutine 56:
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet.func7()
      /Users/[email protected]/go/pkg/mod/github.com/daveshanley/[email protected]/motor/rule_applicator.go:664 +0x158
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet.gowrap1()
      /Users/[email protected]/go/pkg/mod/github.com/daveshanley/[email protected]/motor/rule_applicator.go:704 +0x54

Previous write at 0x00c000716728 by goroutine 57:
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet.func7()
      /Users/[email protected]/go/pkg/mod/github.com/daveshanley/[email protected]/motor/rule_applicator.go:665 +0x170
  github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet.gowrap1()
      /Users/[email protected]/go/pkg/mod/github.com/daveshanley/[email protected]/motor/rule_applicator.go:704 +0x54

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.

1 participant