You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Keith Wall (JIRA)" <ji...@apache.org> on 2015/10/15 14:11:06 UTC

[jira] [Comment Edited] (QPID-6786) (0-10) ServerAssembler fails with IndexOutOfBoundsException on receipt of message with large headers

    [ https://issues.apache.org/jira/browse/QPID-6786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14958801#comment-14958801 ] 

Keith Wall edited comment on QPID-6786 at 10/15/15 12:10 PM:
-------------------------------------------------------------

Hi Lorenz, as discussed, currently {AMQConnection.getMaximumFrameSize()} always returns zero for 0-10 connections, so the new test doesn't actual test what it intends.   Why maximumFrameSize is not wired up on the 0-10 path is not known to me.  There doesn't seem to be harm in fixing it to have the expected behaviour.  It looks like using a {FrameSizeObserver} call back in AMQConnectionDeletegate_0_10 would be one way to fix this.


was (Author: k-wall):
Hi Lorenz, as discussed, currently {{AMQConnection.getMaximumFrameSize()} always returns zero for 0-10 connections, so the new test doesn't actual test what it intends.   Why maximumFrameSize is not wired up on the 0-10 path is not known to me.  There doesn't seem to be harm in fixing it to have the expected behaviour.  It looks like using a {FrameSizeObserver} call back in AMQConnectionDeletegate_0_10 would be one way to fix this.

> (0-10) ServerAssembler fails with IndexOutOfBoundsException on receipt of message with large headers
> ----------------------------------------------------------------------------------------------------
>
>                 Key: QPID-6786
>                 URL: https://issues.apache.org/jira/browse/QPID-6786
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: qpid-java-6.0
>            Reporter: Keith Wall
>            Priority: Blocker
>
> In a regression since 0.32, if I run the following program, the Java Broker fails with the following IOOBE.
> {noformat}
> ava.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> 	at java.util.Collections$SingletonList.get(Collections.java:3375)
> 	at org.apache.qpid.server.protocol.v0_10.ServerDecoder.getCurrentBuffer(ServerDecoder.java:111)
> 	at org.apache.qpid.server.protocol.v0_10.ServerDecoder.advanceIfNecessary(ServerDecoder.java:41)
> 	at org.apache.qpid.server.protocol.v0_10.ServerDecoder.getBuffer(ServerDecoder.java:49)
> 	at org.apache.qpid.server.protocol.v0_10.ServerDecoder.readUint16(ServerDecoder.java:142)
> 	at org.apache.qpid.server.protocol.v0_10.ServerAssembler.assemble(ServerAssembler.java:201)
> 	at org.apache.qpid.server.protocol.v0_10.ServerAssembler.frame(ServerAssembler.java:152)
> 	at org.apache.qpid.server.protocol.v0_10.ServerAssembler.received(ServerAssembler.java:80)
> 	at org.apache.qpid.server.protocol.v0_10.ServerInputHandler.parse(ServerInputHandler.java:175)
> 	at org.apache.qpid.server.protocol.v0_10.ServerInputHandler.received(ServerInputHandler.java:82)
> 	at org.apache.qpid.server.protocol.v0_10.AMQPConnection_0_10$3.run(AMQPConnection_0_10.java:199)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.qpid.server.protocol.v0_10.AMQPConnection_0_10.received(AMQPConnection_0_10.java:191)
> 	at org.apache.qpid.server.transport.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:141)
> 	at org.apache.qpid.server.transport.NonBlockingConnection.processAmqpData(NonBlockingConnection.java:446)
> 	at org.apache.qpid.server.transport.NonBlockingConnectionPlainDelegate.processData(NonBlockingConnectionPlainDelegate.java:58)
> 	at org.apache.qpid.server.transport.NonBlockingConnection.doRead(NonBlockingConnection.java:349)
> 	at org.apache.qpid.server.transport.NonBlockingConnection.doWork(NonBlockingConnection.java:223)
> 	at org.apache.qpid.server.transport.NetworkConnectionScheduler.processConnection(NetworkConnectionScheduler.java:143)
> 	at org.apache.qpid.server.transport.NetworkConnectionScheduler.access$000(NetworkConnectionScheduler.java:37)
> 	at org.apache.qpid.server.transport.NetworkConnectionScheduler$2.run(NetworkConnectionScheduler.java:112)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:745)
> {noformat}
> {noformat:java}
>             ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("qpidConnectionfactory");
>             Connection connection = connectionFactory.createConnection();
>             connection.start();
>             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>             Destination destination = (Destination) context.lookup("topicExchange");
>             MessageProducer messageProducer = session.createProducer(destination);
>             MessageConsumer messageConsumer = session.createConsumer(destination);
>             TextMessage message = session.createTextMessage("Hello world!");
>             message.setStringProperty("str1", new String(new byte[32000]));
>             message.setStringProperty("str2", new String(new byte[32000]));
>             message.setStringProperty("str3", new String(new byte[32000]));
>             messageProducer.send(message);
>             message = (TextMessage)messageConsumer.receive();
>             System.out.println(message.getText());
>             System.out.println(message.getStringProperty("str1").length());
>             System.out.println(message.getStringProperty("str2").length());
>             System.out.println(message.getStringProperty("str3").length());
>             System.out.println(message.getText());
>             connection.close();
>             context.close();
> {noformat}
> Same program passed successfully against 0.32.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org