tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Machowiak <...@ision.net>
Subject Problem: Hang in ajpv12_handle_response()
Date Tue, 10 Apr 2001 14:19:23 GMT
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

Mime
View raw message