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

Andrew Kenworthy edited comment on QPID-6482 at 12/10/15 10:49 AM:
-------------------------------------------------------------------

I am hitting this issue for messages that are far smaller: around the 100-150KB 
mark. I am using EventHub as my input and it looks as though the issue here in 
SessionEndpoint:

{code}
            if(endpoint == null)
            {
                //TODO - error unknown link
                System.err.println("Unknown endpoint " + transfer);

            }

            UnsignedInteger deliveryId = transfer.getDeliveryId();
            if(deliveryId == null)
            {
                deliveryId = 
((ReceivingLinkEndpoint)endpoint).getLastDeliveryId();
            }

            Delivery delivery = _incomingUnsettled.get(deliveryId);
            if(delivery == null)
            {
                delivery = new Delivery(transfer, endpoint);
                _incomingUnsettled.put(deliveryId,delivery);
                if(delivery.isSettled() || 
Boolean.TRUE.equals(transfer.getAborted()))
                {
/*
                    _availableIncomingCredit++;
*/
                }

                if(Boolean.TRUE.equals(transfer.getMore()))
                {
                    
((ReceivingLinkEndpoint)endpoint).setLastDeliveryId(transfer.getDeliveryId());
                }
            }
            else
            {
                if(delivery.getDeliveryId().equals(deliveryId))
{code}

When the error occurs it is because this line returns a null value:
{code}
deliveryId = ((ReceivingLinkEndpoint)endpoint).getLastDeliveryId();
{code}
which may then lead to the map having a key value that is null:
{code}
_incomingUnsettled.put(deliveryId,delivery);
{code}
which leads to the NPE here:
{code}
if(delivery.getDeliveryId().equals(deliveryId))
{code}



was (Author: aken):
I am hitting this issue for Messages that are far smaller: around the 100-150KB 
mark. I am using EventHub as my input and it looks as though the issue here in 
SessionEndpoint:

{code}
            if(endpoint == null)
            {
                //TODO - error unknown link
                System.err.println("Unknown endpoint " + transfer);

            }

            UnsignedInteger deliveryId = transfer.getDeliveryId();
            if(deliveryId == null)
            {
                deliveryId = 
((ReceivingLinkEndpoint)endpoint).getLastDeliveryId();
            }

            Delivery delivery = _incomingUnsettled.get(deliveryId);
            if(delivery == null)
            {
                delivery = new Delivery(transfer, endpoint);
                _incomingUnsettled.put(deliveryId,delivery);
                if(delivery.isSettled() || 
Boolean.TRUE.equals(transfer.getAborted()))
                {
/*
                    _availableIncomingCredit++;
*/
                }

                if(Boolean.TRUE.equals(transfer.getMore()))
                {
                    
((ReceivingLinkEndpoint)endpoint).setLastDeliveryId(transfer.getDeliveryId());
                }
            }
            else
            {
                if(delivery.getDeliveryId().equals(deliveryId))
{code}

When the error occurs it is because this line returns a null value:
{code}
deliveryId = ((ReceivingLinkEndpoint)endpoint).getLastDeliveryId();
{code}
which may then lead to the map having a key value that is null:
{code}
_incomingUnsettled.put(deliveryId,delivery);
{code}
which leads to the MPE here:
{code}
if(delivery.getDeliveryId().equals(deliveryId))
{code}


> NPE in SessionEndpoint.receiveTransfer when receiving large message
> -------------------------------------------------------------------
>
>                 Key: QPID-6482
>                 URL: https://issues.apache.org/jira/browse/QPID-6482
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.32
>            Reporter: Mark Soderquist
>
> We are occasionally seeing the following exception when receiving a message 
> of 500000 bytes. Sometimes it helps to increase the receive timeout but not 
> always:
> java.lang.NullPointerException
>       at 
> org.apache.qpid.amqp_1_0.transport.SessionEndpoint.receiveTransfer(SessionEndpoint.java:435)
>       at 
> org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint.receiveTransfer(ConnectionEndpoint.java:655)
>       at 
> org.apache.qpid.amqp_1_0.type.transport.Transfer.invoke(Transfer.java:285)
>       at 
> org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint.receive(ConnectionEndpoint.java:808)
>       at 
> org.apache.qpid.amqp_1_0.framing.FrameHandler.parse(FrameHandler.java:241)
>       at 
> org.apache.qpid.amqp_1_0.framing.ConnectionHandler.parse(ConnectionHandler.java:75)
>       at 
> org.apache.qpid.amqp_1_0.client.TCPTransportProvider.doRead(TCPTransportProvider.java:244)
>       at 
> org.apache.qpid.amqp_1_0.client.TCPTransportProvider.access$000(TCPTransportProvider.java:47)
>       at 
> org.apache.qpid.amqp_1_0.client.TCPTransportProvider$1.run(TCPTransportProvider.java:185)
>       at java.lang.Thread.run(Thread.java:745)
> Unknown endpoint 
> Transfer{handle=0,deliveryId=0,deliveryTag=\x00\x00\x00\x00\x00\x00\x00\x00,messageFormat=0}



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

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

Reply via email to