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

Cachelock #5974

Merged
merged 5 commits into from
May 9, 2024
Merged

Cachelock #5974

merged 5 commits into from
May 9, 2024

Conversation

shawkins
Copy link
Contributor

@shawkins shawkins commented May 1, 2024

Description

Fixes #5973

Replaces #5699 as there have been no updates there in a while. Tweaks the previous pr to address the concerns mentioned in the review and to limit global locking to only methods that mutate the indexes / index functions.

Also some minor refactoring to make the CacheImpl logic a little more streamlined.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@manusa
Copy link
Member

manusa commented May 7, 2024

For some reason, there are tests failing. However, none of the modified production code seems to be related to these failures.

@shawkins
Copy link
Contributor Author

shawkins commented May 7, 2024

For some reason, there are tests failing. However, none of the modified production code seems to be related to these failures.

There was a subtle change that indexes used to allow null keys before, and now they don't with this code - I hadn't fully paid attention to a null check that was added in the previous pr. It seems like we should preserve that behavior, so I'll make an update.

@shawkins
Copy link
Contributor Author

shawkins commented May 7, 2024

@manusa this looks better, but still hit some test flakiness.

@shawkins
Copy link
Contributor Author

shawkins commented May 8, 2024

@manusa should be good now. That test really wasn't of much use, so it's been removed. I did preserve the use of the concurrenthashmap for the index, but didn't see it made much difference of a synchronized map as we're never doing any iteration.

@manusa manusa added this to the 6.13.0 milestone May 9, 2024 — with automated-tasks
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

LGTM, thx!

Copy link

sonarqubecloud bot commented May 9, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
60.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@manusa manusa merged commit 27e0842 into fabric8io:main May 9, 2024
20 of 21 checks passed
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.

Reduce CacheImpl lock contention
4 participants