tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olaf Tomczak <olaf.tomc...@gmail.com>
Subject Http11NioProtocol error 505 (or 400)
Date Mon, 27 Dec 2010 17:59:20 GMT
Hi,

I'm using Http11NioProtocol connector on my Tomcat 6.0.29 instance and I
noticed that sometimes I experience strange responses:
- 400 - Bad Request,
- 505 - HTTP Version Not Supported

My first conclusion was that it's somewhat related to the size of the
request (e.g. clearing session cookies always fixed the problem). I then
recompiled Tomcat from sources adding some additional logs
to Http11NioProcessor and InternalNioInputBuffer classes. I also isolated a
test request that always fails on my test server instace and used it as a
JMeter test configuration.

I'm using the following connector configuration:

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="256" minSpareThreads="32"/>
<Connector executor="tomcatThreadPool"
        acceptorThreadCount="4"
        useComet="false"
        address="0.0.0.0"
        port="4080"
        protocol="org.apache.coyote.http11.Http11NioProtocol"
        connectionTimeout="30000"
        redirectPort="4443"
        enableLookups="false"
        />

Looking at my logs I found out that the request fails with the following
scenario:

InternalNioInputBuffer.parseRequestLine - successfully parses the first
request line
InternalNioInputBuffer.parseHeader - parses some headers but then fails to
read more data and returns with HeaderParseStatus.NEED_MORE_DATA status
InternalNioInputBuffer.parseRequestLine - is called again and then tries to
parse the remaining headers and fails with 505 since it takes a part of
'User-Agent' header value as a protocol name.

Can someone familiar with the Http11NioProtocol connector help me with this
problem?

I also noticed that when a use a local instance of Tomcat (on the same host
as my jmeter) with the same configuration the requests work (I suppose it's
because the connection is faster and more data is available in the buffer
without delay).

Thanks a lot,
Olaf Tomczak

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message