• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

In apache + tomcat env, what does the user see if a tomcat thread dies

I am running Apache 2.0.44 with Tomcat 4.1.24 connected by mod_jk with multiple tomcat instances.

My question is, if a tomcat thread dies (say due to an out of memory error), what will the end user's experience of this be?

Will they recieve an error page?  Will the request simply not happen (ie they click on a button and nothing happens)? or will apache notice the lack of response from tomcat and pass the request off to another thread?

0
sharonfrench
Asked:
sharonfrench
  • 3
1 Solution
 
ramazanyichCommented:
If tomcat server dies (or apache httpd server couldn't connect to it) then user will get "Service Temporarily Unavailable" error. (HTTP return code 503).
If you want change default response then you can some html page using
ErrorDocument 503 some_error_page_for_error_503.htm
0
 
sharonfrenchAuthor Commented:
I'm actually interested in finding out what will happen if one of the tomcat processor threads dies.

So apache gets a request, forwards it on to tomcat and the tomcat processor thread handling that request dies (with an OutOfMemoryError or some such).

What sort of response (if any) does apache get from tomcat, and what happens next?  Does apache realize that there was a problem and resubmit the request to tomcat, or does it return 503 to the client? Or...
0
 
ramazanyichCommented:
if there is a tcp connection to tomcat alive then response will be returned by Tomcat server. And by default it will be an error stacktrace
0
 
ramazanyichCommented:
if you don't want to return stacktrace to client you can add custom error pages response in web.xml file of your web application:
<error-page>
        <error-code>500</error-code>
        <location>/server_error.html</location>
    </error-page>
<error-page>
        <error-code>404</error-code>
        <location>/file_not_found.html</location>
    </error-page>
...

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now