Skip to content

Conversation

@dmitryax
Copy link
Member

@dmitryax dmitryax commented Jul 8, 2025

It was ignored before because the PersistRequestContextOnRead and PersistRequestContextOnWrite variables were initialized before the feature gate was set from the command line arguments.

Resolves #13342

@dmitryax dmitryax marked this pull request as ready for review July 8, 2025 19:46
@dmitryax dmitryax requested review from a team, bogdandrutu, dmathieu and mx-psi as code owners July 8, 2025 19:46
@dmitryax dmitryax force-pushed the fix-PersistRequestContext-fg branch from d6423ab to 7a16214 Compare July 8, 2025 19:48
@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.56%. Comparing base (120736c) to head (8af6b02).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13359      +/-   ##
==========================================
+ Coverage   91.52%   91.56%   +0.04%     
==========================================
  Files         528      528              
  Lines       29478    29478              
==========================================
+ Hits        26980    26992      +12     
+ Misses       1969     1960       -9     
+ Partials      529      526       -3     

☔ 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.

Comment on lines 19 to 20
PersistRequestContextOnRead = func() bool { return PersistRequestContextFeatureGate.IsEnabled() }
PersistRequestContextOnWrite = func() bool { return PersistRequestContextFeatureGate.IsEnabled() }
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't this be:

Suggested change
PersistRequestContextOnRead = func() bool { return PersistRequestContextFeatureGate.IsEnabled() }
PersistRequestContextOnWrite = func() bool { return PersistRequestContextFeatureGate.IsEnabled() }
PersistRequestContextOnRead = PersistRequestContextFeatureGate.IsEnabled
PersistRequestContextOnWrite = PersistRequestContextFeatureGate.IsEnabled

Copy link
Member

Choose a reason for hiding this comment

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

It can, but I would suggest we just remove the 2 temp vars and use the feature gate all the time.

Copy link
Member Author

Choose a reason for hiding this comment

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

It can, but I would suggest we just remove the 2 temp vars and use the feature gate all the time.

Yeah, but otherwise it's very complicated to test the cases when the feature gate is changed while there is data in the persistent store

Choose a reason for hiding this comment

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

Sure, but you need only the happy path to be tested in the e2e with real ptrace. For the enable/disable you can have unit-tests directly in the persistent_queue_test file and have this featuregate passed in the constructor (as hidden property) to the queue.

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 try this as a follow-up

It was ignored before because the PersistRequestContextOnRead and PersistRequestContextOnWrite variables were initialized before the feature gate was set from the command line arguments.
@dmitryax dmitryax force-pushed the fix-PersistRequestContext-fg branch from 7a16214 to 8af6b02 Compare July 9, 2025 15:24
@dmitryax dmitryax added this pull request to the merge queue Jul 9, 2025
Merged via the queue into open-telemetry:main with commit af0fffd Jul 9, 2025
52 of 56 checks passed
@dmitryax dmitryax deleted the fix-PersistRequestContext-fg branch July 9, 2025 20:14
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.

persistent queue metadata not preserved (v0.129.0)

4 participants