ColdFusion 9 behaviour with java.lang.Error

It seems that a java.lang.Error can cause problems for a CF9 server.

The test case looks like this:



Couple interesting things happen when I run this:

Firstly, I get no error page. No response body at all, just a response header with a status of “500 blah”. Fair enough, java.lang.Error is supposed to mean a serious unrecoverable error so when receiving it ColdFusion is quite right in just stopping. File that under “things I should have known but for some reason never came across”.

Secondly, and more worryingly, if I refresh the page a couple of times I pretty quickly run into this:

Server Error
The server encountered an internal error and was unable to complete your request.

Application server is busy. Either there are too many concurrent requests or the server still is starting up.

with the accompanying entry in the Apache error log

returning error page for Jrun too busy or out of memory

In fact I might get that “server busy” error for any other page on the server, not just a refresh of my test page. After a while it “fixes” itself, as in no more server busy errors. Until the next time I run my test page.

What does this all mean? My guess would be that Jrun quite reasonably decides to nuke the thread that has reported the serious and unrecoverable error, but then quite unreasonably sends the next request into the post-nuke radioactive wasteland of that thread. The thread, in a fit of post-holocaust dudgeon, refuses to respond at all, and Apache can do nothing but convey the bad news to the long-suffering user. Once the thread has expired out of the thread pool the problem vanishes.

It’d be interesting to know if this happens in CF10. In the meantime, I’m off to work out why my java code is throwing a java.lang.Error in the first place.

Environment stuff: CF 9.02 running whatever version of Apache2 is current for Ubuntu 12.04; CF9.01 on ditto ditto Apache2 ditto Ubuntu 9.04

2 thoughts on “ColdFusion 9 behaviour with java.lang.Error

  1. Just for the sake of gathering more information: I get the error as per your description, but not the server falling over. CF 9.0.2 on Win Vista 64-bit, just using the internal JWS web server.


    Adam

  2. Cool, thanks for the data point. I don’t pretend to know anything about the internals, but I’d guess that the Apache connector is holding on to the dead thread and the JWS server isn’t.

Leave a Reply

Your email address will not be published. Required fields are marked *