You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Andre Machowiak <am...@ision.net> on 2001/04/10 16:19:23 UTC

Problem: Hang in ajpv12_handle_response()

Hi developers!

Got a problem with Apache-1.3.19 with Tomcat-3.2.1 (mod_jk.so) on Solaris2.7
(sparc): There are about 500 httpds on one machine. Occasionally one 
or more of them hang. They do nothing but taking lots of cpu time.
The connection for this process has died. The client has no connection any
more and on the server a netstat says "closed_wait".

A stacktrace shows that the httpd makes no system calls.

The logfile:
[jk_ajp12_worker.c (596)]: ajpv12_handle_response, error writing back to server
[jk_ajp12_worker.c (596)]: ajpv12_handle_response, error writing back to server
... 500 lines deleted ...
[jk_ajp12_worker.c (596)]: ajpv12_handle_response, error writing back to server
[jk_ajp12_worker.c (596)]: ajpv12_handle_response, error writing back to server
[jk_ajp12_worker.c (596)]: ajpv12_handle_response, error writing back to server

If I look with gdb in the process it hangs in ajpv12_handle_response() from
which the process will never return.

---jakarta-tomcat-3.2.1-src/src/native/apache1.3/jk_ajp12_worker.c---

static int ajpv12_handle_response(ajp12_endpoint_t *p,
                                  jk_ws_service_t *s,
                                  jk_logger_t *l)
{
....
....
....
    while(1) {
        unsigned to_read = READ_BUF_SIZE;
        unsigned acc = 0;
        char *buf = NULL;
    
        if(!jk_sb_read(&p->sb, &buf, to_read, &acc)) {
            jk_log(l, JK_LOG_ERROR, "ajpv12_handle_response, error reading from \n");
            return JK_FALSE;
        }

        if(!acc) { 
            jk_log(l, JK_LOG_DEBUG, "ajpv12_handle_response, response body is done\n");
            break;
        }

        if(write_to_ws) {
            if(!s->write(s, buf, acc)) {
                jk_log(l, JK_LOG_ERROR, "ajpv12_handle_response, error writing back to server\n");
                write_to_ws = JK_FALSE;
            }
        }
    }
---------------

My guess is, that in the body of the last if()-clause is a missing break- oder
return- statement or something like that. 

Can anybody confirm this?
Maybe I am on the wrong way and there's another solution for my problem with
the hanging httpd.

Thank you very much,
- Andre Machowiak -

-- 
---------------------------------------------------------------------------
ISION Sales + Service GmbH & Co. KG      Andre Machowiak (ama@ision.net)
Harburger Schlossstrasse 1               Administrator Application Services
21079 Hamburg - Germany                  Telefon: +49 40 77175-156
http://www.ision.net