-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Logging: test multithreaded logging #57448
base: master
Are you sure you want to change the base?
Logging: test multithreaded logging #57448
Conversation
8eed463
to
2db9213
Compare
This comment was marked as resolved.
This comment was marked as resolved.
2db9213
to
5a5fe27
Compare
5a5fe27
to
349709a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to make the code actually correct first before adding tests for new uses cases which may be unreliable
By "new use cases" do you mean logging from tasks running on other threads? |
Yes, that has never been allowed before |
Ok then I think we need to do two things:
Hopefully we can avoid 2) by just fixing the stuff in 1) first, but I am unaware of the issues, and I believe from slack that you have a private list of issues @vtjnash so it'd be good to make that public. I'll happily look into fixing this, I just am unfamiliar with the issue(s). |
Could you confirm that this multi-threaded hello world program is in your opinion a user error: Threads.@spawn @info "Hello from thread $(Threads.threadid())" |
Yes, only functions that declare themselves thread-safe may be used |
Since the point of the logging macros is to abstract away the mechanics of how the logs are processed, doesn't an otherwise thread-safe function becoming unsafe by virtue of some logging statements violate expectations for this abstraction? |
Investigating #57376
With and without the redirect there's no crash locally.
Ideally it'd be good to test logging to the console but I don't think we can do that without noisy logs on the console..