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: concurrent SlugifyName access (#18369) #18370

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

Conversation

mhotan
Copy link

@mhotan mhotan commented May 22, 2024

Fixes 18369

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@mhotan mhotan requested a review from a team as a code owner May 22, 2024 22:02
Signed-off-by: Mike Hotan <mike@union.ai>
@mhotan mhotan force-pushed the mhotan/fix-18369 branch from 3afa1c0 to 7ffc97c Compare May 22, 2024 22:04
@mhotan mhotan requested a review from a team as a code owner May 22, 2024 22:04
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.68%. Comparing base (8776cc1) to head (7ffc97c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #18370   +/-   ##
=======================================
  Coverage   45.68%   45.68%           
=======================================
  Files         353      353           
  Lines       46965    46967    +2     
=======================================
+ Hits        21454    21456    +2     
  Misses      22772    22772           
  Partials     2739     2739           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mhotan
Copy link
Author

mhotan commented May 29, 2024

Ideally, this simple logic should not require being gated by a Mutex. That being said, I doubt we will be able to update the underlying library. Two PRs have been stale for at least three years.

If we are not comfortable using a Mutex we should probably update the documentation indicating Slugify is not multi-thread safe.

Copy link
Contributor

@andrii-korotkov-verkada andrii-korotkov-verkada left a comment

Choose a reason for hiding this comment

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

Note: you need to specify # before the issue number in the PR description for the bot to actually close it.

@@ -324,6 +324,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [UFirstGroup](https://www.ufirstgroup.com/en/)
1. [ungleich.ch](https://ungleich.ch/)
1. [Unifonic Inc](https://www.unifonic.com/)
1. [Union Inc](https://www.union.ai/)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's have a separate PR for this

// Necessary mutex due to global shared state.
// https://github.com/argoproj/argo-cd/issues/18369
slugifyNameMutex.Lock()
defer slugifyNameMutex.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we can defer locking to below the loop

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.

2 participants