<div dir="ltr">Hi Everyone,<div><br></div><div>I have been thinking a bit about the way we report errors in WildFly, and I think this is something that we can improve on. At the moment I think we are way to liberal with what we report, which results in a ton of services being listed in the error report that have nothing to do with the actual failure.</div><div><br></div><div>As an example to work from I have created [1], which is a simple EJB application. This consists of 10 EJB&#39;s, one of which has a reference to a non-existant data source, the rest are simply empty no-op EJB&#39;s (just @Stateless on an empty class).</div><div><br></div><div>This app fails to deploy because the java:global/NonExistant data source is missing, which gives the failure description in [2]. This is ~120 lines long and lists multiple services for every single component in the application (part of the reason this is so long is because the failures are reported twice, once when the deployment fails and once when the server starts).</div><div><br></div><div>I think we can improve on this. I think in every failure case there will be some root causes that are all the end user cares about, and we should limit our reporting to just these cases, rather than listing every internal service that can no longer start due to missing transitive deps.</div><div><br></div><div>In particular these root causes are:</div><div>1) A service threw and exception in its start() method and failed to start</div><div>2) A dependency is actually missing (i.e. not installed, not just not started)</div><div><br></div><div>I think that one or both of these two cases will be the root cause of any failure, and as such that is all we should be reporting on.</div><div><br></div><div>We already do an OK job of handing case 1), services that have failed, as they get their own line item in the error report, however case 2) results in a huge report that lists every service that has not come up, no matter how far removed they are from the actual problem.</div><div><br></div><div>I think we could make a change to the way this is reported so that only direct problems are reported [3], so the error report would look something like [4] (note that this commit only changes the operation report, the container state reporting after boot is still quite verbose).</div><div><br></div><div>I am guessing that this is not as simple as it sounds, otherwise it would have already been addressed, but I think we can do better that the current state of affairs so I thought I would get a discussion started.</div><div><br></div><div>Stuart</div><div><br></div><div>[1] <a href="https://github.com/stuartwdouglas/errorreporting">https://github.com/stuartwdouglas/errorreporting</a></div><div>[2] <a href="https://gist.github.com/stuartwdouglas/b52a85813913f3304301eeb1f389fae8">https://gist.github.com/stuartwdouglas/b52a85813913f3304301eeb1f389fae8</a> </div><div>[3] <a href="https://github.com/stuartwdouglas/wildfly-core/commit/a1fbc831edf290971d54c13dd1c5d15719454f85">https://github.com/stuartwdouglas/wildfly-core/commit/a1fbc831edf290971d54c13dd1c5d15719454f85</a></div><div>[4] <a href="https://gist.github.com/stuartwdouglas/14040534da8d07f937d02f2f08099e8d">https://gist.github.com/stuartwdouglas/14040534da8d07f937d02f2f08099e8d</a></div></div>