Skip to content

Fix data race in deletion_worker.go#468

Merged
lukeatdell merged 2 commits into
usr/spark/unit-test-improvementsfrom
usr/lukeatdell/deletion-worker-data-race
Feb 26, 2025
Merged

Fix data race in deletion_worker.go#468
lukeatdell merged 2 commits into
usr/spark/unit-test-improvementsfrom
usr/lukeatdell/deletion-worker-data-race

Conversation

@lukeatdell

@lukeatdell lukeatdell commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

Description

Refactoring adding volumes to deletion queue
Running populateDeletionQueue() as a goroutine was causing data races with unsafe concurrent access to the http client of the powermax client while running powermax REST API queries.
Instead of running the whole function as a goroutine, only create goroutines for queue insertion operations. Since the queue insertion function needs no reference to the powermax client, there should be no issues.

Also removed a log message in locks.go that printed every 20ms.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #

Checklist:

  • Have you run format,vet & lint checks against your submission?
  • Have you made sure that the code compiles?
  • Did you run the unit & integration tests successfully?
  • Have you maintained at least 85% and 90% code coverage?
  • Have you commented your code, particularly in hard-to-understand areas
  • Have you done corresponding changes to the documentation
  • Did you run tests in a real Kubernetes cluster?
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

- running populateDeletionQueue as a goroutine was causing data races with unsafe access to the http client of the powermax client.
- instead of running the whole function as a goroutine, only run the queue insertion func as a goroutine.
@lukeatdell lukeatdell merged commit 50750a3 into usr/spark/unit-test-improvements Feb 26, 2025
@lukeatdell lukeatdell deleted the usr/lukeatdell/deletion-worker-data-race branch February 26, 2025 19:14
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.

3 participants