james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: Packet is larger than max_allowed_packet (with maxmessagesize set to 95K smaller!)
Date Wed, 04 Sep 2002 06:17:22 GMT
It is the JDBC driver.  For those who care, see
org.gjt.mm.mysql.Buffer.ensureCapacity (below).

As I read it before heading off to bed (which means all bets are off), a 25%
factor is necessary between the maximum message size and the max_packet_size
to prevent this code from throwing an exception.  So if you want a 4MB
maximum message size, you need a 5MB max_packet size.  Or a 4MB
max_packet_size allows only a 3.2MB max message.

Somewhere we should document this for the next poor guy.

	--- Noel

 final void ensureCapacity(int additional_data)
 {
     if ((_pos + additional_data) > _bufLength)
     {
         int new_length = (int)(_bufLength * 1.25);

         if (new_length < (_bufLength + additional_data))
         {
             new_length = _bufLength +
                          (int)(additional_data * 1.25);
         }

         if (_maxLength != NO_LENGTH_LIMIT &&
             (new_length > _maxLength))
         {
             throw new IllegalArgumentException(
                     "Packet is larger than max_allowed_packet from server
configuration of " +
                     _maxLength + " bytes");
         }

         byte[] NewBytes = new byte[new_length];
         System.arraycopy(_buf, 0, NewBytes, 0, _buf.length);
         _buf = NewBytes;
         _bufLength = _buf.length;
     }
 }

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com]
Sent: Wednesday, September 04, 2002 1:51
To: James-Dev Mailing List
Subject: Packet is larger than max_allowed_packet (with maxmessagesize
set to 95K smaller!)


As shown by the following log, even though I have set the max message size
to 409600, and my max packet size for mysql is 4193280, a difference of 95K,
after the message is accepted it is being failed by the driver.  Apparently
the message being accepted is less than 409600, but somehow it still
generates an error.

Any clues?  I'll look deeper at the code (and the driver code if need be) in
the AM.

	--- Noel

04/09/02 01:02:22 INFO  smtpserver: Hello Name is: [removed]
04/09/02 01:02:22 DEBUG smtpserver: Max message size is: 4096000
04/09/02 01:02:22 INFO  smtpserver: Connection from [removed]
04/09/02 01:02:22 DEBUG smtpserver: Sent: 220 [removed] SMTP Server (JAMES
SMTP Server 2.1a1-cvs) ready Wed, 4 Sep 2002 01:02:22 -0400
(EDT)
04/09/02 01:02:22 DEBUG smtpserver: Command received: HELO [removed]
04/09/02 01:02:22 DEBUG smtpserver: Sent: 250 [removed] Hello [removed]
04/09/02 01:02:22 DEBUG smtpserver: Command received: MAIL
FROM:<xxxx@yyyy.ca>
04/09/02 01:02:22 DEBUG smtpserver: Sent: 250 Sender <xxxx@yyyy.ca> OK
04/09/02 01:02:22 DEBUG smtpserver: Command received: RCPT TO:
<zzzz@wwww.org>
04/09/02 01:02:22 DEBUG smtpserver: Sent: 250 Recipient <zzzz@wwww.org> OK
04/09/02 01:02:22 DEBUG smtpserver: Command received: DATA
04/09/02 01:02:22 DEBUG smtpserver: Sent: 354 Ok Send data ending with
<CRLF>.<CRLF>
04/09/02 01:02:22 DEBUG smtpserver: Using SizeLimitedInputStream  with max
message size: 4096000
04/09/02 01:03:32 DEBUG smtpserver: Sent: 451 Error processing message:
Exception spooling message: Exception caught while storing mail Container:
java.lang.IllegalArgumentException: Packet is larger than max_allowed_packet
from server configuration of 4193280 bytes;
  nested exception is:
        java.lang.RuntimeException: Exception caught while storing mail
Container: java.lang.IllegalArgumentException: Packet is larger than
max_allowed_packet from server configuration of 4193280 bytes
04/09/02 01:03:32 ERROR smtpserver: 451 Error processing message: Exception
spooling message: Exception caught while storing mail Container:
java.lang.IllegalArgumentException: Packet is larger than max_allowed_packet
from server configuration of 4193280 bytes;
  nested exception is:
        java.lang.RuntimeException: Exception caught while storing mail
Container: java.lang.IllegalArgumentException: Packet is larger than
max_allowed_packet from server configuration of 4193280 bytes
04/09/02 01:03:32 DEBUG smtpserver: Command received: QUIT
04/09/02 01:03:32 DEBUG smtpserver: Sent: 221 mail.devtech.com Service
closing transmission channel
04/09/02 01:03:32 DEBUG smtpserver: Closing socket.


--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message