Skip to content

fix(profiler): implement __aenter__ and __aexit__ for asyncio.Lock - #3676

Merged
Kyle-Verhoog merged 2 commits into
DataDog:1.xfrom
Kyle-Verhoog:prof-asyncio-lock
May 6, 2022
Merged

Kyle-Verhoog merged 2 commits into
DataDog:1.xfrom
Kyle-Verhoog:prof-asyncio-lock

Conversation

@Kyle-Verhoog

@Kyle-Verhoog Kyle-Verhoog commented May 5, 2022 •

Copy link
Copy Markdown
Member

wrapt.ObjectProxy does not implement these methods (see GrahamDumpleton/wrapt#73) so we need to add them to the asyncio.Lock proxy.

Fixes #3655

@Kyle-Verhoog Kyle-Verhoog added this to the v1.2.0 milestone May 5, 2022
@Kyle-Verhoog
Kyle-Verhoog requested a review from a team as a code owner May 5, 2022 18:35
brettlangdon
brettlangdon previously approved these changes May 5, 2022
mabdinur
mabdinur previously approved these changes May 5, 2022
@majorgreys

Copy link
Copy Markdown
Contributor

@Mergifyio backport 1.0 1.1

@mergify

mergify Bot commented May 5, 2022

Copy link
Copy Markdown
Contributor

backport 1.0 1.1

🟠 Waiting for conditions to match

Details
  • merged [:pushpin: backport requirement]

@Kyle-Verhoog

Copy link
Copy Markdown
Member Author

ugh seems like the module gets imported in Python 2.7 so there's a syntax error under 2.7 😕

@brettlangdon

Copy link
Copy Markdown
Member

ugh seems like the module gets imported in Python 2.7 so there's a syntax error under 2.7 😕

do we just need a _lock_py3.py module/version?

@Kyle-Verhoog Kyle-Verhoog changed the title fix(profiler): implement aenter and aexit for asyncio.Lock fix(profiler): implement __aenter__ and __aexit__ for asyncio.Lock May 5, 2022
@Kyle-Verhoog
Kyle-Verhoog dismissed stale reviews from mabdinur and brettlangdon via 04a4226 May 6, 2022 01:47
@Kyle-Verhoog
Kyle-Verhoog force-pushed the prof-asyncio-lock branch 3 times, most recently from a984714 to 096a272 Compare May 6, 2022 02:11
@Kyle-Verhoog

Copy link
Copy Markdown
Member Author

We can get by with using normal methods since they are just proxies (we don't have to await anything)

@codecov-commenter

codecov-commenter commented May 6, 2022 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 78.08%. Comparing base (c41d325) to head (94af0aa).
Report is 1768 commits behind head on 1.x.

Files with missing lines Patch % Lines
ddtrace/profiling/collector/_lock.py 0.00% 4 Missing ⚠️
tests/profiling/collector/test_asyncio.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #3676      +/-   ##
==========================================
- Coverage   78.11%   78.08%   -0.04%     
==========================================
  Files         645      646       +1     
  Lines       50014    50052      +38     
==========================================
+ Hits        39070    39082      +12     
- Misses      10944    10970      +26     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread ddtrace/profiling/collector/_lock.py Resolved
@Kyle-Verhoog
Kyle-Verhoog merged commit 3bc5271 into DataDog:1.x May 6, 2022
mergify Bot pushed a commit that referenced this pull request May 6, 2022
`wrapt.ObjectProxy` does not implement these methods (see GrahamDumpleton/wrapt#73) so we need to add them to the `asyncio.Lock` proxy.

(cherry picked from commit 3bc5271)

# Conflicts:
#	tests/profiling/collector/test_asyncio.py
@Kyle-Verhoog
Kyle-Verhoog deleted the prof-asyncio-lock branch May 6, 2022 14:05
mergify Bot pushed a commit that referenced this pull request May 6, 2022
`wrapt.ObjectProxy` does not implement these methods (see GrahamDumpleton/wrapt#73) so we need to add them to the `asyncio.Lock` proxy.

(cherry picked from commit 3bc5271)
@mergify

mergify Bot commented May 6, 2022

Copy link
Copy Markdown
Contributor

backport 1.0 1.1

✅ Backports have been created

Details

Kyle-Verhoog added a commit that referenced this pull request May 6, 2022
…3685)

`wrapt.ObjectProxy` does not implement these methods (see GrahamDumpleton/wrapt#73) so we need to add them to the `asyncio.Lock` proxy.

(cherry picked from commit 3bc5271)

Co-authored-by: Kyle Verhoog <[email protected]>
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.

1.1.0 asyncio.Lock replacement missing __aexit__

7 participants