Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] [Jetty-AJP-Bug] java.io.IOException: FULL

Hi,

I got a problem. The exception's stack looks like
JETTY-1310[http://jira.codehaus.org/browse/JETTY-1310].
---------------------------------------------------------------
2012-03-28 14:29:09.892:WARN::handle failed
java.io.IOException: FULL
       at org.mortbay.jetty.ajp.Ajp13Parser.fill(Ajp13Parser.java:200)
       at org.mortbay.jetty.ajp.Ajp13Parser.parseNext(Ajp13Parser.java:555)
       at org.mortbay.jetty.ajp.Ajp13Parser.parseAvailable(Ajp13Parser.java:1
       at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
       at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnecto
       at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool
-----------------------------------------------------------------

But the cause is not posted data bigger than the max length of AJP13
packet (e.g. 8192 bytes). So the problem is different from the
JETTY-1310.

The real cause is in the following code:
jetty 6.1.22: org.mortbay.jetty.ajp.Ajp13Parser (504 line):
_contentLength > (_header.capacity() - _header.getIndex())
---------------------------------------------------------------
504                    if (_buffers != null && _body == null &&
_buffer == _header && _contentLength > (_header.capacity() -
_header.getIndex()))
505                    {
506                        _body =
_buffers.getBuffer(Ajp13Packet.MAX_PACKET_SIZE);
507                        _body.clear();

508                    }
---------------------------------------------------------------

Description:
If posted size of the (AJP_FORWARD_HEADER + POST_DATA) less than the
max size of AJP13 packet, then Jetty will reuse current buffer. But,
if the POST_DATA is split many REQ_BODYs to be sent, then the total
size of the (AJP_FORWARD_HEADER + REQ_BODY * TIMES) may be bigger than
the size of reused buffer(8192 bytes). So the jetty may throw
java.io.IOException: FULL. (Refer to AJP13 spec.
http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html)

The attached is reproduce script.
I have found the problem in the 6.1.22 and 7.6.x; (Note: the data
bound of 7.6.x is bigger than 6.1.22)

Three solutions:
1. Remove the code _contentLength > (_header.capacity() -
_header.getIndex()) from Ajp13Parser . (How about the solution? Please
evaluate it.)
2. Change the  code _contentLength > (_header.capacity() -
_header.getIndex()) to  _contentLength * 7 > (_header.capacity() -
_header.getIndex()). (If post data is transferred one byte by one
byte, the total size will be six times bigger than then original data)
2. Change AJP to HTTP.

Joans Yang
03/29/2012

Attachment: AjpBufferFullException.java
Description: Binary data


Back to the top