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

Bug: decorators not awaiting decorated class method #1091

Closed
dreamorosi opened this issue Sep 19, 2022 · 1 comment · Fixed by #1108
Closed

Bug: decorators not awaiting decorated class method #1091

dreamorosi opened this issue Sep 19, 2022 · 1 comment · Fixed by #1108
Assignees
Labels
bug Something isn't working completed This item is complete and has been merged/shipped tracer This item relates to the Tracer Utility

Comments

@dreamorosi
Copy link
Contributor

Bug description

In #1085 it has been reported that Logger is affected by a bug that causes the decorator to not properly await the decorated method. During the review of the PR that is expected to fix #1085, @ijemmy correctly pointed out that this same faulty behavior also affects Tracer's decorators.

In the case of Tracer the actions performed after the decorated method has returned are silent in the sense that they don't produce any output. This made it harder for customers or maintainers to spot the bug.

Expected Behavior

The decorated method should be awaited correctly and all cleanup/post return actions should be performed after the decorated method has returned.

Current Behavior

The decorated method is not awaited and in case of async methods this might cause the segment created for the method to be closed too early.

Possible Solution

Await the decorated methods. In the case of non-async method this will result in a no-op so it shouldn't impact these methods.

Steps to Reproduce

N/A

Environment

  • Powertools version used: 1.2.1 or earlier
  • Packaging format (Layers, npm): All
  • AWS Lambda function runtime: All
  • Debugging logs: N/A

Related issues, RFCs

#1085

@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release This item has been merged and will be released soon label Oct 11, 2022
@dreamorosi dreamorosi removed the pending-release This item has been merged and will be released soon label Oct 27, 2022
@dreamorosi dreamorosi changed the title Bug (tracer): decorators not awaiting decorated class method Bug: decorators not awaiting decorated class method Nov 14, 2022
@dreamorosi dreamorosi added the completed This item is complete and has been merged/shipped label Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed This item is complete and has been merged/shipped tracer This item relates to the Tracer Utility
Projects
None yet
1 participant