-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Missing error logs when application crashes on OTP-26 #9163
Comments
I suspect those problems may be linked to changes in this commit:
|
Thanks for the report. It is easy enough to reproduce, so should be relatively easy to figure out what is going on. I did some
|
I looked into this issue a little bit and it seems to be related to changes I've linked before. Module init.erl executes start.boot script, which has loading commands at the end, like this:
Because of application_controller failed during load of myapp, it started terminating mode so it's sending
Because adding sasl to dependency causes application booting to be reordered, so failing application is loaded as last in this scenario. |
Thanks for the help with the analysis. This patch seems to fix the problem:
Now I just need to figure out if that is the correct thing to do, or if it will break something else... |
Describe the bug
If application returns error, entire system terminates, but there is no info about crashed application in logs.
To Reproduce
I tried it on docker image erlang:26, with newest version of rebar3 installed:
Create umbrella using rebar3:
Edit "myapp_app.erl" so it returns error. Add some logger:errors to file e.g.:
I added timer:sleep(1000) so it can be seen clearly that only some logs are present in log file.
Setup logger to log to external file:
Release application:
Run released application as deamon.
Check generated default.log1 and erlang.log.1 file:
Expected behavior
All given logs are present before erlang crashes due to error. This error is not present in OTP-25 afaik, tried the same method on erlang:25 and it shows not only entirety of log given by application, but also shows which application has crashed inside erlang.log.1:
Affected versions
OTP-26 (26.2.5.2), OTP-27(27.1.2)
Additional context
The text was updated successfully, but these errors were encountered: