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
ActiveJob AsyncAdapter swallows exceptions, doesn't log by default #26848
Comments
cc @jdantonio |
This is expected behavior, but the suggested change is fairly easy. Please see PR #26852. Application level exception handling is not a responsibility of High level abstractions in concurrent-ruby all provide robust error handling and reporting features by passing a job wrapper to the thread pool. With respect to |
@jdantonio: Your PR looks like it addresses my problem - I should be able to see what's going wrong now when using the default development settings. I also think it's good for the exceptions to show up in the test logs, as it looks like they will (to your point about I agree that monkeying with things in concurrent-ruby to address this is non-ideal, though it might be nice to be able to easily route The only remaining detail that I had was if there is a way for the AJ logging to say something different than "Performed", but it doesn't look like that's an option. "Performed" appears to be used by all adapters, regardless if there is an exception in the |
(On Rails 5.0.0.1)
Using the default AsyncAdapter in development, I was disappointed that I didn't see errors from my jobs even though I knew they were throwing exceptions (undefined methods, etc.). I would see the following messages in my log:
If I set the following in an initializer:
I get the errors printed on my terminal (not in
log/development.log
). I believe this is due to the logic inConcurrent::RubyThreadPoolExecutor::Worker#run_task
.It seems like with AsyncAdapter being the new development default, there should be something that notifies developers of job errors in the default setup. At least, perhaps an initializer that sets the Concurrent logger according to other Rails logger settings? But it might also be ideal for ActiveJob not to record "Performed MyJob", and instead say something like "Failed MyJob"
The text was updated successfully, but these errors were encountered: