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: run metrics storage after bootstraping queues #442

Merged
merged 1 commit into from
Dec 9, 2022
Merged

Conversation

diafour
Copy link
Contributor

@diafour diafour commented Dec 9, 2022

Overview

RunMetrics starts go routines that access the TaskQueueSet info thus data race appears at start.

==================
WARNING: DATA RACE
Read at 0x00c00026fbc0 by goroutine 50:
  github.com/flant/shell-operator/pkg/task/queue.(*TaskQueueSet).Iterate()
  github.com/flant/shell-operator/pkg/shell-operator.(*ShellOperator).RunMetrics.func2()

Previous write at 0x00c00026fbc0 by main goroutine:
  runtime.mapassign_faststr()
      /usr/local/Cellar/go/1.17.2/libexec/src/runtime/map_faststr.go:202 +0x0
  github.com/flant/shell-operator/pkg/task/queue.(*TaskQueueSet).NewNamedQueue()
...

Goroutine 50 (running) created at:
  github.com/flant/shell-operator/pkg/shell-operator.(*ShellOperator).RunMetrics()
...

RunMetrics start tickers that access to TaskQueueSet info thus data race appears at start.

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
@diafour diafour self-assigned this Dec 9, 2022
@diafour diafour requested a review from yalosev December 9, 2022 10:11
@diafour diafour merged commit fe8f611 into main Dec 9, 2022
@diafour diafour added this to the 1.1.0 milestone Dec 9, 2022
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.

None yet

1 participant