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

fix: Clearing transaction context for held transactions and async WCF client instrumentation timing. #1608

Merged
merged 2 commits into from
May 9, 2023

Conversation

nrcventura
Copy link
Member

@nrcventura nrcventura commented May 5, 2023

Thank you for submitting a pull request. Please review our contributing guidelines and code of conduct.

Description

There are 2 changes in this PR to address 2 different but related problems caught by the WCF client integration tests.

  1. When asynchronous instrumentation uses the hold-release pattern, the transaction is not removed from the transaction context storage when the response time for that transaction is captured. This can lead to, in some situations, where instrumented code that runs after the "held" but not yet "released" transaction will reuse that transaction instead of creating a new one.
  2. The continuation used to end the async segment/span for the WCF client call can sometimes be delayed too long (waiting until the task scheduler finds a convenient time) leading to the external call time being artificially extended and the transaction duration being artificially extended.

To address the first problem, this PR clears out the transaction storage context when the response time for a transaction is captured.

To address the second problem, this PR provides continuation hints so that the task scheduler will attempt to execute our continuation as soon as possible after the WCF client call completes.

Author Checklist

  • Unit tests, Integration tests, and Unbounded tests completed
  • Performance testing completed with satisfactory results (if required)

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)

@codecov-commenter
Copy link

Codecov Report

Merging #1608 (0661f83) into main (dceecc7) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1608   +/-   ##
=======================================
  Coverage   76.89%   76.90%           
=======================================
  Files         406      406           
  Lines       25192    25192           
=======================================
+ Hits        19372    19373    +1     
+ Misses       5820     5819    -1     

see 1 file with indirect coverage changes

@nrcventura nrcventura changed the title DO_NOT_MERGE: Register synchronous continuation for WCF client instrumentation. fix: Clearing transaction context for held transactions and async WCF client instrumentation timing. May 8, 2023
@nrcventura nrcventura marked this pull request as ready for review May 8, 2023 21:28
Copy link
Member

@tippmar-nr tippmar-nr left a comment

Choose a reason for hiding this comment

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

Nice work!

@nrcventura nrcventura merged commit db9a48e into main May 9, 2023
@nrcventura nrcventura deleted the experiment/wcfclient-use-sync-continuation branch May 9, 2023 16:00
Copy link
Member

@nr-ahemsath nr-ahemsath left a comment

Choose a reason for hiding this comment

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

Already merged, but I figured I'd say good job anyway! 🥇

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.

6 participants