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

[ASP.NET Core] Do not reset baggage on request stop event #4274

Conversation

vishweshbankwar
Copy link
Member

@vishweshbankwar vishweshbankwar commented Mar 6, 2023

Fixes #2992

Follow up #4274 (comment)
Ran the stress test using bombardier tool command

bombardier-windows-amd64.exe -d 12h -r 50 --header="baggage: key=value" <url>

Monitored the process using dotnet-counters monitor for any memory leaks

snippets after ~10 hr run

With this change
image

With main
WithoutChange

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

@vishweshbankwar vishweshbankwar changed the title [ASP.NET Core] Do not reset baggage on requeststop [ASP.NET Core] Do not reset baggage on request stop event Mar 10, 2023
@vishweshbankwar vishweshbankwar marked this pull request as ready for review March 10, 2023 18:51
@vishweshbankwar vishweshbankwar requested a review from a team as a code owner March 10, 2023 18:51
var textMapPropagator = Propagators.DefaultTextMapPropagator;
if (textMapPropagator is not TraceContextPropagator)
{
Baggage.Current = default;
Copy link
Member

Choose a reason for hiding this comment

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

should this be done at SDK side instead? Could you run stress tests to confirm there are no leaks if we do not remove it at all.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did run stress test. Did not see any leaks.

Copy link
Member Author

@vishweshbankwar vishweshbankwar Mar 10, 2023

Choose a reason for hiding this comment

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

should this be done at SDK side instead?

Are you referring to OnEnd in SDK? I have not looked in to that but just thinking it will impact all activities as we need to first check the activity ending is ASP.NET Core one.

Copy link
Member

Choose a reason for hiding this comment

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

Baggage should be independent of any activity, so why we need to check which activity is being stopped?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only for ASP.NET Core activity. For other one's we do not do anything right now as well.

@codecov
Copy link

codecov bot commented Mar 10, 2023

Codecov Report

Merging #4274 (3616c23) into main (c501cb3) will decrease coverage by 0.03%.
The diff coverage is n/a.

❗ Current head 3616c23 differs from pull request most recent head 0154e55. Consider uploading reports for the commit 0154e55 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4274      +/-   ##
==========================================
- Coverage   83.32%   83.30%   -0.03%     
==========================================
  Files         314      314              
  Lines       12525    12522       -3     
==========================================
- Hits        10437    10431       -6     
- Misses       2088     2091       +3     
Impacted Files Coverage Δ
...tation.AspNetCore/Implementation/HttpInListener.cs 90.12% <ø> (-0.18%) ⬇️

... and 2 files with indirect coverage changes

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale label Mar 18, 2023
@github-actions
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Mar 26, 2023
@github-actions github-actions bot removed the Stale label Apr 19, 2023
Copy link
Member

@alanwest alanwest left a comment

Choose a reason for hiding this comment

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

LGTM

public async Task BaggageClearedWhenActivityStopped()
public async Task BaggageIsNotClearedWhenActivityStopped()
Copy link
Member

Choose a reason for hiding this comment

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

Not a blocking comment... but if the instrumentation had never had this behavior, then we likely would never had this test in the first place. Perhaps we just remove this test completely?

Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 20, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@cijothomas
Copy link
Member

/easycla

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2023

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale label May 5, 2023
@utpilla utpilla merged commit b9908d1 into open-telemetry:main May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to log baggages via a processor
5 participants