-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
ActiveSupport::TaggedLogging does not persist context in a Fiber #37535
Comments
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
The issue is still relevant in Rails 6.0.2.1 |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
The issue is still relevant in 6.0.2.2 |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
Steps to reproduce
In a new Rails application in the console just type:
This is similar (but not equal) to: #28156 In that issue the conversation is around threads.
Expected behavior
That should output:
Actual behavior
The output is
and the tags are lost
Comments
The behaviour for threads is tested in: https://github.com/rails/rails/blob/v6.0.0/activesupport/test/tagged_logging_test.rb#L75-L84
but there is no information for Fibers. The current implementation does not pass the tags for threads (and probably it is not easy to do) but making it work for Fibers probably should be just changing this method
rails/activesupport/lib/active_support/tagged_logging.rb
Lines 51 to 55 in 88fe8d9
Thread.current.current_variable_set
andThread.current.current_variable_get
instead because:I can create the PR myself but I'd first love to know if what I am saying makes sense or you explicitly don't want this to work for Fibers. In such case I can PR a test that intentionally excludes Fibers so it is explicit.
System configuration
Rails version: 6.0.0
Ruby version: 2.6.2p47
Thanks a lot!
The text was updated successfully, but these errors were encountered: