[jboss-jira] [JBoss JIRA] Commented: (JGRP-667) Occasionally, messages get too large for the UDP transport
Bela Ban (JIRA)
jira-events at lists.jboss.org
Fri Jan 18 06:27:21 EST 2008
[ http://jira.jboss.com/jira/browse/JGRP-667?page=comments#action_12395611 ]
Bela Ban commented on JGRP-667:
-------------------------------
Possible solutions
#1 (short-term): Add all headers in JGroups to magic-map.xml
#2 Make every Header return a valid and unique magic number. We detect at startup whether all headers have a valid magic number and fail if not. This is difficult to achieve with external headers, e.g. headers created by users. Maybe we need to add a getMagicNumber() to Header and make all subclasses implement it. JGroups-internal classes get the magic numbers from magic-map.xml, external headers simply pick a (hopefully) unique magic number (above 1024).
#3 Make Message.size() check if a Header has a magic number or not. If yes, add 2 bytes, else add the length of the classname +2. Disadvantage: this may be slow
I favor #2 so far
> Occasionally, messages get too large for the UDP transport
> ----------------------------------------------------------
>
> Key: JGRP-667
> URL: http://jira.jboss.com/jira/browse/JGRP-667
> Project: JGroups
> Issue Type: Bug
> Reporter: Bela Ban
> Assigned To: Bela Ban
> Fix For: 2.7, 2.6.2
>
>
> When message bundling is enabled (say max_bytes=60K), every now and then we get a larger message (say 70K), and then the msg is dropped because UDP has a size limit of 65K.
> This can happen as follows:
> - Either magic-map.xml is not found or some headers are not in magic-map
> - Say we accumulated 100 messages in the message bundler. Before adding a new message, the bundler
> checks its size (Message.size()), which calls size() on all headers
> - A header just assumes it has a magic number and returns its size, including 2 bytes for the magic number (a
> short)
> - If magic-number.xml is not found, or some headers have no magic number, then we write the fully qualified
> classname of the class into the stream. So let's assume that's 30 bytes versus the 2 size() returned.
> - If we have 3 headers/msg which have the additional 28 bytes, and 100 messages, then the serialized
> message is 8400 bytes larger than what Message.size() returned
> - So the marshalled message is now 68400 bytes and it will get discarded by UDP !
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list