Skip to content

Conversation

@gpauloski
Copy link
Collaborator

Description

Improve thread-safety in the Store by making the LRUCache thread safe and adding locks around connector and state changing operations in the Store.

I don't anticipate this having a measurable performance impact because most applications don't perform Store operations across many threads. The exception is that some applications may resolve a proxy across many threads. In that case, the changes will prevent full on crashes when the same proxy is resolved in multiple threads, but may reduce performance when different proxies/targets are resolved in different threads. However, this does not matter if the connector is also implemented with locks to prevent concurrent operations.

Fixes

Type of Change

  • Breaking Change (fix or enhancement which changes existing semantics of the public interface)
  • Enhancement (new features or improvements to existing functionality)
  • Bug (fixes for a bug or issue)
  • Internal (refactoring, style changes, testing, optimizations)
  • Documentation update (changes to documentation or examples)
  • Package (dependencies, versions, package metadata)
  • Development (CI workflows, pre-commit, linters, templates)
  • Security (security related changes)

Testing

All test cases still pass.

I ran the TaPS example reported in #604 and this reliably fixes the issue.

Pull Request Checklist

Please confirm the PR meets the following requirements.

  • Tags added to PR (e.g., breaking, bug, enhancement, internal, documentation, package, development, security).
  • Code changes pass pre-commit (e.g., mypy, ruff, etc.).
  • Tests have been added to show the fix is effective or that the new feature works.
  • New and existing unit tests pass locally with the changes.
  • Docs have been updated and reviewed if relevant.

@gpauloski gpauloski added the bug Error, flaw, or fault that causes unexpected behavior label Aug 19, 2024
@gpauloski gpauloski merged commit 1454f75 into main Aug 19, 2024
@gpauloski gpauloski deleted the issue-604 branch August 19, 2024 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Error, flaw, or fault that causes unexpected behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyError in cache eviction of Store

2 participants