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

Add TraceCache Guarded Iteration #704

Merged
merged 15 commits into from Dec 7, 2022
Merged

Add TraceCache Guarded Iteration #704

merged 15 commits into from Dec 7, 2022

Conversation

TimPansino
Copy link
Contributor

@TimPansino TimPansino commented Dec 1, 2022

Overview

  • Implements APIs for MutableMapping ABC on TraceCache.
  • Refactor existing calls to trace_cache._cache to use pass through APIs.
  • Properly guard trace_cache from RuntimeErrors raised due to concurrent iteration and size changes of the TraceCache.
    • For a full writeup of what was tested see this gist

Related Github Issue

Issues

PRs

Testing

  • Unit and concurrent stress tests have been added with verified negative testing.
  • Underlying theory tested and working, see gist above.

@TimPansino TimPansino requested a review from a team as a code owner December 1, 2022 00:31
@github-actions
Copy link

github-actions bot commented Dec 1, 2022

🦙 MegaLinter status: SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
PYTHON bandit 2 0 2.63s
PYTHON black 6 0 0 0.81s
PYTHON flake8 6 0 0.48s
PYTHON isort 6 0 0 0.18s
PYTHON pylint 6 0 4.9s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@umaannamalai umaannamalai added this to the v8.5.0 milestone Dec 1, 2022
Copy link
Contributor

@hmstepanek hmstepanek left a comment

Choose a reason for hiding this comment

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

Looks good overall. Again, thank you for really digging in and getting to the bottom of this! I had a just a couple small requests/recommendations.

newrelic/core/trace_cache.py Show resolved Hide resolved
tests/agent_unittests/test_trace_cache.py Outdated Show resolved Hide resolved
Copy link
Contributor

@hmstepanek hmstepanek left a comment

Choose a reason for hiding this comment

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

One little fixup requested otherwise looks good. I'm just gonna pre-approve this one.

tests/agent_unittests/test_trace_cache.py Outdated Show resolved Hide resolved
@TimPansino TimPansino merged commit f977ba6 into main Dec 7, 2022
43 checks passed
@TimPansino TimPansino deleted the fix-weakref-iteration branch December 7, 2022 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants