-
Couldn't load subscription status.
- Fork 395
Add support for ActiveRecord async queries #4872
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
base: master
Are you sure you want to change the base?
Conversation
|
BenchmarksBenchmark execution time: 2025-10-06 13:25:01 Comparing candidate commit 48f5976 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 42 metrics, 2 unstable metrics. scenario:line instrumentation - targeted
scenario:method instrumentation
|
e9f4f3e to
a9061db
Compare
**What does this PR do?** Adds support for Rails load_async feature by implementing the publish method and enhancing the ActiveSupport notifications subscription system with proper callback handling and error management. **Motivation:** Rails load_async feature requires support for the publish method in ActiveSupport notifications to handle asynchronous event processing. The existing subscription system needed enhancements to properly support this Rails feature. **Change log entry** Added support for Rails load_async feature in ActiveSupport notifications subscription **Additional Notes:** - Implements publish method for complete event lifecycle handling - Adds robust error handling for callbacks and handlers - Includes comprehensive test coverage (38 examples, 0 failures) - Ensures system continues functioning when individual callbacks fail **How to test the change?** Run: bundle exec rspec spec/datadog/tracing/contrib/active_support/notifications/subscription_spec.rb Tests verify load_async functionality including: - publish method event lifecycle - Handler and Callbacks error handling - Integration with Rails async event processing
44947b2 to
29f080e
Compare
Resolved conflicts in gemfile lock files and ruby-3.4.gemfile: - Updated libddwaf from 1.25.1.0.1 to 1.25.1.1.0 (master has newer version) - Added steep ~> 1.10 gem and removed duplicate steep 1.9.1 - Standard is now enabled in test suite - Multiple gemfile.lock updates for consistency
9b8c3fc to
ee804f0
Compare
e66d246 to
1f34e82
Compare
Fixes #3465
Async query execution, introduced in Rails 7.0.0 and expanded in Rails 7.1.0, now correctly parents the async spans to the context where the query resolution happens.
This context is the place where the results from the async query were consumed. For example:
async_relation = Model.load_asyncschedules the async query, but the query span is only attached to the active trace atrelation.loadtime). This only affects parenting, as the execution time of the async span is always accurate.The active trace, started in a thread, will now see spans from a background async thread attached to it.
Change log entry
Yes. Add support for ActiveRecord async queries
Additional Notes:
How to test the change?