Skip to content

fix: data races#747

Merged
yalosev merged 25 commits into
mainfrom
fix/data-race
Apr 11, 2025
Merged

fix: data races#747
yalosev merged 25 commits into
mainfrom
fix/data-race

Conversation

@juev
Copy link
Copy Markdown
Contributor

@juev juev commented Apr 8, 2025

Overview

Fixing data races in code and tests

What this PR does / why we need it

Some edits

Evsyukov Denis added 3 commits April 8, 2025 12:26
Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
… double start

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
@juev juev added the enhancement New feature or request label Apr 8, 2025
@juev juev requested review from Copilot, ldmonster and yalosev April 8, 2025 10:13
@juev juev self-assigned this Apr 8, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread pkg/kube_events_manager/monitor.go Outdated
Evsyukov Denis added 2 commits April 8, 2025 13:17
Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
@juev juev added run/tests Run tests on full matrix of k8s versions go Pull requests that update Go code labels Apr 8, 2025
@github-actions github-actions Bot removed the run/tests Run tests on full matrix of k8s versions label Apr 8, 2025
…o interfaces, replace maps with sync.Map for concurrency safety

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
… and improved memory management

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
Evsyukov Denis added 2 commits April 8, 2025 17:16
…nd improved memory management

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
@juev juev requested a review from Copilot April 8, 2025 14:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

pkg/schedule_manager/schedule_manager.go:18

  • Converting ScheduleManager from an interface to a concrete struct type may break abstraction boundaries and affect consumers expecting an interface. Confirm that this change is intentional and that all dependent code is updated accordingly.
type ScheduleManager struct {

Comment thread test/hook/context/generator.go Outdated
Evsyukov Denis added 2 commits April 9, 2025 08:49
Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
… management

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
@juev juev requested a review from Copilot April 9, 2025 06:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

test/hook/context/generator.go:132

  • [nitpick] Consider using b.started.Store(true) instead of Swap(true) if the previous value is not required, as it more clearly conveys that the flag is simply being set.
b.started.Swap(true)

pkg/kube_events_manager/kube_events_manager.go:100

  • If no monitor exists for the given monitorID, calling monitor.Start(mgr.ctx) may result in a nil pointer dereference. Consider adding a nil check and error handling before starting the monitor.
monitor := mgr.Monitors[monitorID]

Evsyukov Denis added 2 commits April 9, 2025 09:45
…s for improved memory management

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
…d error handling for missing monitors

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
Evsyukov Denis added 3 commits April 9, 2025 10:46
…anager and ScheduleManager for consistency

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
…dling

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
…ger and ScheduleManager for consistency

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
Evsyukov Denis added 2 commits April 9, 2025 11:09
…or tests

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
…y and consistency

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
…nt informer creation

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
@juev juev requested a review from Copilot April 9, 2025 08:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread pkg/kube_events_manager/monitor_test.go Outdated
Evsyukov Denis added 4 commits April 9, 2025 16:23
…d cancellation functions

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
…y range operations

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
…ng existence before invocation

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
…-specific factory store in resource informer

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
@juev juev force-pushed the fix/data-race branch 2 times, most recently from fc33841 to f3e8c45 Compare April 10, 2025 09:05
…ager for consistent informer management

Signed-off-by: Evsyukov Denis <denis.evsyukov@flant.com>
@juev juev marked this pull request as ready for review April 10, 2025 09:25
@yalosev yalosev requested review from ldmonster and miklezzzz and removed request for ldmonster April 10, 2025 09:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@miklezzzz miklezzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a breath of fresh air :)

@yalosev yalosev merged commit 553b6da into main Apr 11, 2025
8 checks passed
@yalosev yalosev deleted the fix/data-race branch April 11, 2025 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants