[Spread-users] Invalid message in high load group

Marcin Kuthan mkuthan at pit.edu.pl
Wed Aug 31 09:05:19 EDT 2005

Hi All

I have a problem with Java clients on high load group. Header of spread
message is not decoded correctly, and java.lang.OutOfMemoryError is
thrown. Java spread client expect following header structure:

1. type (4 bytes)
2. sender (MAX_GROUP_NAME bytes) - typically 32
3. numGroups (4 bytes)
4. hint (4 bytes)
5. dataLen (4 bytes)

But on high load group I sometimes receive another header:
1. type is missing, header start with group name (NOT sender, length
looks like MAX_GROUP_NAME)
2. next four bytes contains 0,0,0,28 (decimal)
3. next four bytes contains 2,0,0,0 (decimal)
4. next four bytes contains 10,0,0,0 (decimal)
5. next four bytes contains -123,0,0,0 (decimal)

numGroups field is decoded to very large number and allocation of byte
array throws an OutOfMemoryError. Even if I check numGroups size and
error is not thrown my clients will not receive any new messages.

When I turn on SESSION debug flag in spread.conf I get following logs:
Sess_badger: for mbox 9

High load environment is mean about 10.000 msg/sec. My software:

OS: Linux woody (gcc 2.95, libc 2.2.5)
spread: 3.17.3 (with MAX_SESSION_MESSAGES set to 10000)
java: 1.4.2_08

Any help would be appreciated.

Telecommunication Research Institute
Poligonowa 30, 04-051 Warszawa, Poland

Marcin Kuthan
mail:     mkuthan at pit.edu.pl
phone:    +48 (22) 486-53-46

More information about the Spread-users mailing list