Bug 507399

Summary: lstr only holds 65309 bytes
Product: Red Hat Enterprise MRG Reporter: Matthew Farrellee <matt>
Component: qpid-qmfAssignee: messaging-bugs <messaging-bugs>
Status: CLOSED EOL QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 1.1.1CC: iboverma, jross, tross
Target Milestone: ---Keywords: Improvement
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-21 14:54:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Farrellee 2009-06-22 16:14:08 UTC
Description of problem:

Sending an lstr appears to fail if it is larger than 65309 bytes.


Version-Release number of selected component (if applicable):

$ rpm -q qpidc qmf python
qpidc-0.5.752600-5.fc10.i386
qmf-0.5.752600-5.fc10.i386
python-2.5.2-1.fc10.i386


How reproducible:

100%


--

- size success -

$ time ./echo-perf.py amqp://localhost:5672 1 65309
Found broker: org.apache.qpid.broker:broker[0-0-1-0-1152921504606846978]
0-0-1-0-1152921504606846977:5672
Iteractions: 1
Message size: 65309 bytes
Start: 1245379213.21
End: 1245379213.23
Total messages: 1
Total time: 0.0185179710388 seconds
Date rate: 3402.10057937 KiB/s
Response rate: 54.001596498 Hz
./echo-perf.py amqp://localhost:5672 1 65309  1.47s user 0.08s system
80% cpu 1.909 total

- size fail -

$ time ./echo-perf.py amqp://localhost:5672 1 65310
Found broker: org.apache.qpid.broker:broker[0-0-1-0-1152921504606846978]
0-0-1-0-1152921504606846977:5672
Iteractions: 1
Message size: 65310 bytes
Start: 1245379218.22
Traceback (most recent call last):
  File "./echo-perf.py", line 29, in <module>
    r = broker.echo(i, message)
  File "/usr/lib/python2.5/site-packages/qmf/console.py", line 1071, in
<lambda>
    return lambda *args, **kwargs : self._invoke(name, args, kwargs)
  File "/usr/lib/python2.5/site-packages/qmf/console.py", line 1128, in
_invoke
    self._session.seqMgr._release(seq)
NameError: global name 'seq' is not defined
./echo-perf.py amqp://localhost:5672 1 65310  1.45s user 0.07s system 2%
cpu 1:01.80 total

--

#!/usr/bin/env python

from qmf.console import Session
from sys import exit, argv
import time

url = len(argv) > 1 and argv[1] or "amqp://localhost:5672"
count = len(argv) > 2 and int(argv[2]) or 10000
# size note: ../python2.5/../qpid/packer.py:36: DeprecationWarning: 'H'
format requires 0 <= number <= 65535
size = len(argv) > 3 and int(argv[3]) or 1024

message = "1"*size

session = Session();
session.addBroker(url)
brokers = session.getObjects(_class="broker",
_package="org.apache.qpid.broker")
broker = brokers[0]

print "Found broker:", broker
print "Iteractions:", count
# is "1" really a byte?
print "Message size:", size, "bytes"

start = time.time()

print "Start:", start

for i in xrange(count):
    r = broker.echo(i, message)
    if r.status or r.sequence != i:
        print "text:", r.text, "sequence:", r.sequence, "(expected:", i, ")"
        count = i
        break
#    if r.body != message:
#        print "message mismatch, received:", r.body
#        count = i
#        break

end = time.time()

print "End:", end
print "Total messages:", count
print "Total time:", end-start, "seconds"
print "Date rate:", ((count * size)/1024.0)/(end-start), "KiB/s"
print "Response rate:", count/(end-start), "Hz"

exit(0)

Comment 1 Justin Ross 2011-11-14 21:17:55 UTC
Last I recall, this is a fundamental issue with the underlying messaging type and therefore not easy to fix.  Comments, Ted?

Marking this as an improvement for RFE review for 2.2/0.16-mrg.

Comment 2 Ted Ross 2013-05-13 14:56:31 UTC
(In reply to comment #1)
> Last I recall, this is a fundamental issue with the underlying messaging
> type and therefore not easy to fix.  Comments, Ted?
> 
> Marking this as an improvement for RFE review for 2.2/0.16-mrg.

This is an architectural issue when using AMQP 0-10 (it has strings with 8 and 16 bit lengths only).

In AMQP 1.0, there is a str32-utf8 type that has a 32-bit length field.  An AMQP 1.0-based update to QMF (involving a protocol change) would remove this limitation.