[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=920704=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-920704
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 23/May/24 16:43
Start Date: 23/May/24 16:43
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on PR #4932:
URL: 
https://github.com/apache/activemq-artemis/pull/4932#issuecomment-2127615471

   Replaced by #4942




Issue Time Tracking
---

Worklog Id: (was: 920704)
Time Spent: 3h 20m  (was: 3h 10m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=920703=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-920703
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 23/May/24 16:43
Start Date: 23/May/24 16:43
Worklog Time Spent: 10m 
  Work Description: gemmellr closed pull request #4932: ARTEMIS-4771 Avoid 
NPE while delivering amqp large message after a close
URL: https://github.com/apache/activemq-artemis/pull/4932




Issue Time Tracking
---

Worklog Id: (was: 920703)
Time Spent: 3h 10m  (was: 3h)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=920702=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-920702
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 23/May/24 16:42
Start Date: 23/May/24 16:42
Worklog Time Spent: 10m 
  Work Description: gemmellr merged PR #4942:
URL: https://github.com/apache/activemq-artemis/pull/4942




Issue Time Tracking
---

Worklog Id: (was: 920702)
Time Spent: 3h  (was: 2h 50m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 3h
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=920697=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-920697
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 23/May/24 15:26
Start Date: 23/May/24 15:26
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on code in PR #4942:
URL: https://github.com/apache/activemq-artemis/pull/4942#discussion_r1611907602


##
artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriterTest.java:
##
@@ -0,0 +1,255 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.protocol.amqp.proton;
+
+import static org.junit.Assert.fail;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import org.apache.activemq.artemis.core.message.LargeBodyReader;
+import 
org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManager;
+import org.apache.activemq.artemis.core.server.MessageReference;
+import org.apache.activemq.artemis.protocol.amqp.broker.AMQPLargeMessage;
+import org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback;
+import 
org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection;
+import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
+import org.apache.qpid.proton.engine.Connection;
+import org.apache.qpid.proton.engine.Delivery;
+import org.apache.qpid.proton.engine.EndpointState;
+import org.apache.qpid.proton.engine.Sender;
+import org.apache.qpid.proton.engine.Session;
+import org.apache.qpid.proton.engine.impl.TransportImpl;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+
+/**
+ * Tests for the AMQP Large Message Writer
+ */
+public class AMQPLargeMessageWriterTest {
+
+   @Mock
+   ProtonServerSenderContext serverSender;
+
+   @Mock
+   Sender protonSender;
+
+   @Mock
+   Session protonSession;
+
+   @Mock
+   Connection protonConnection;
+
+   @Mock
+   TransportImpl protonTransport;
+
+   @Mock
+   Delivery protonDelivery;
+
+   @Mock
+   MessageReference reference;
+
+   @Mock
+   AMQPLargeMessage message;
+
+   @Mock
+   LargeBodyReader bodyReader;
+
+   @Mock
+   AMQPConnectionContext connectionContext;
+
+   @Mock
+   AMQPSessionContext sessionContext;
+
+   @Mock
+   AMQPSessionCallback sessionSPI;
+
+   @Mock
+   org.apache.activemq.artemis.spi.core.remoting.Connection 
transportConnection;
+
+   @Mock
+   ActiveMQProtonRemotingConnection remotingConnection;
+
+   @Spy
+   NullStorageManager nullStoreManager = new NullStorageManager();
+
+   @Before
+   public void setUp() {
+  MockitoAnnotations.openMocks(this);
+
+  when(serverSender.getSessionContext()).thenReturn(sessionContext);
+  when(serverSender.getSender()).thenReturn(protonSender);
+  when(serverSender.createDelivery(any(), 
anyInt())).thenReturn(protonDelivery);
+
+  when(protonSender.getSession()).thenReturn(protonSession);
+  when(protonSession.getConnection()).thenReturn(protonConnection);
+  when(protonConnection.getTransport()).thenReturn(protonTransport);
+  when(protonTransport.getOutboundFrameSizeLimit()).thenReturn(65535);
+
+  
when(transportConnection.getProtocolConnection()).thenReturn(remotingConnection);
+  when(reference.getMessage()).thenReturn(message);
+  when(message.isLargeMessage()).thenReturn(true);
+  when(message.getLargeBodyReader()).thenReturn(bodyReader);
+  when(sessionContext.getSessionSPI()).thenReturn(sessionSPI);
+  
when(sessionContext.getAMQPConnectionContext()).thenReturn(connectionContext);
+  

[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=920684=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-920684
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 23/May/24 15:03
Start Date: 23/May/24 15:03
Worklog Time Spent: 10m 
  Work Description: tabish121 opened a new pull request, #4942:
URL: https://github.com/apache/activemq-artemis/pull/4942

   …closed
   
   If the writer is closed while flow controlled write attempts are pending in 
the connection executor an NPE is thrown which should be avoided as the closed 
state should trigger the writes to stop. Add fix and test that checks that this 
works as it should.




Issue Time Tracking
---

Worklog Id: (was: 920684)
Time Spent: 2h 40m  (was: 2.5h)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=920072=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-920072
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 20/May/24 16:17
Start Date: 20/May/24 16:17
Worklog Time Spent: 10m 
  Work Description: tabish121 commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1606982803


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   I reviewed the existing code again and the Writer is still confined to the 
connection thread unlike the modifications that moved some of the large message 
reader off that thread.  This would imply that a simple check on closed is 
sufficient here as this case would just be an already scheduled run of this 
writer that was behind the remote close handling.  





Issue Time Tracking
---

Worklog Id: (was: 920072)
Time Spent: 2.5h  (was: 2h 20m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919982=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919982
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 20/May/24 09:16
Start Date: 20/May/24 09:16
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1606489945


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   The close method is only safe to call on the connection thread, which is 
where it appears to be being called. Are you seeing otherwise? If not there is 
no benefit in introducing the 3 additional variables and complicating the code 
with a huge if statement (might even mislead folks into thinking there is some 
safety there isnt). Should be no need for synchronization as the writing code 
is not called concurrently. It would seem its simply running from a previous 
scheduling, but no longer needs to. If so that can be addressed by checking 
'closed' at the start of the scheduled task if it was closed already before 
proceeding. 





Issue Time Tracking
---

Worklog Id: (was: 919982)
Time Spent: 2h 20m  (was: 2h 10m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919965=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919965
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 20/May/24 02:29
Start Date: 20/May/24 02:29
Worklog Time Spent: 10m 
  Work Description: clebertsuconic commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1606177252


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   @gemmellr the exception is a network disconnect. Client disconnects and a 
network failure is transmitted. Close is called.
   
   For that we need to either use a cached local variable or add 
synchronization.
   
   I suggest we add a local cache as it doesn't really matter if we just send 
stuff on the already closed session. Adding synchronization on the write may 
risk deadlocks.
   
   
   I'm not able to fix it this week as I'm going out for a week. if you desire 
to pick up this issue please close my PR and open a new one.
   
   
   I will keep my as draft until I can come back into this.





Issue Time Tracking
---

Worklog Id: (was: 919965)
Time Spent: 2h 10m  (was: 2h)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919710=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919710
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 16/May/24 15:27
Start Date: 16/May/24 15:27
Worklog Time Spent: 10m 
  Work Description: clebertsuconic commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1603598360


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   ok.. I will make the change and add a test.
   
   
   although the test is somewhat difficult as I think you need flowControl / 
resume to make it happen. 
   
   
   although I could make a mockTest. If I can't reproduce it with a simple 
consumer being closed I will create a mock test.





Issue Time Tracking
---

Worklog Id: (was: 919710)
Time Spent: 2h  (was: 1h 50m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919692=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919692
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 16/May/24 13:01
Start Date: 16/May/24 13:01
Worklog Time Spent: 10m 
  Work Description: tabish121 commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1603302310


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   If the code is being used as it was originally intended and only accessed 
from one thread the check on closed state should be all that's needed yes. 





Issue Time Tracking
---

Worklog Id: (was: 919692)
Time Spent: 1h 50m  (was: 1h 40m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919655=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919655
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 16/May/24 08:59
Start Date: 16/May/24 08:59
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602912035


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   The message writer isnt thread safe overall and isnt really expected to be. 
It looks like the close method is only accessed on the connection thread, same 
as the writing methods. The closed variable looks to only be volatile due to 
its other uses in checking writability of the sender from other threads.





Issue Time Tracking
---

Worklog Id: (was: 919655)
Time Spent: 1h 40m  (was: 1.5h)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919612=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919612
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 15/May/24 23:21
Start Date: 15/May/24 23:21
Worklog Time Spent: 10m 
  Work Description: clebertsuconic commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602361845


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   I don't want to introduce any performance issue. I would prefer going safe.  
   
   





Issue Time Tracking
---

Worklog Id: (was: 919612)
Time Spent: 1.5h  (was: 1h 20m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919610=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919610
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 15/May/24 23:17
Start Date: 15/May/24 23:17
Worklog Time Spent: 10m 
  Work Description: tabish121 commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602358744


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   I don't see how not throwing an NPE due to thread synchronization issues 
isn't best solved by proper thread synchronization...
   
   With the current fix it could continue writing after the close if the close 
is happening on another thread than the write as the values being checked 
aren't synced on a barrier so they could be non-null for more than one 
execution until a cache flush is forced by some other barrier. It might not NPE 
now but it still isn't guaranteed to stop when you intended it to. 





Issue Time Tracking
---

Worklog Id: (was: 919610)
Time Spent: 1h 20m  (was: 1h 10m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919608=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919608
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 15/May/24 23:05
Start Date: 15/May/24 23:05
Worklog Time Spent: 10m 
  Work Description: clebertsuconic commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602351080


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   The goal is to not Throw a npe.  Not needed synchronization for that. 





Issue Time Tracking
---

Worklog Id: (was: 919608)
Time Spent: 1h 10m  (was: 1h)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919607=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919607
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 15/May/24 23:02
Start Date: 15/May/24 23:02
Worklog Time Spent: 10m 
  Work Description: tabish121 commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602349518


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   So why not just add synchronization if your goal is to make the code thread 
safe?  





Issue Time Tracking
---

Worklog Id: (was: 919607)
Time Spent: 1h  (was: 50m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919605=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919605
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 15/May/24 22:10
Start Date: 15/May/24 22:10
Worklog Time Spent: 10m 
  Work Description: clebertsuconic commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602306503


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   
https://github.com/apache/activemq-artemis/blob/14e83faa1bf5523d63755ec54f42cbc1d21affc6/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java#L126-L134
   
   
   so.. one thread is in resetClose.. another thread is on the tryDeliver...
   
   
   closed is only set to true at the end of the statement...
   
   as a result you could the NPE.
   
   
   you may say set closed first...but still I don't feel like this is 
completely atomic without added synchronization... however I don't want 
synchrnoization here.. just a local copy and checking it should be enough for 
me.
   
   
   I plan to add a test on this.





Issue Time Tracking
---

Worklog Id: (was: 919605)
Time Spent: 50m  (was: 40m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919604=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919604
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 15/May/24 22:08
Start Date: 15/May/24 22:08
Worklog Time Spent: 10m 
  Work Description: clebertsuconic commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602304910


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   If I checked just closed, I guess you could still hit the NPE. You could 
check the closed variable.. but I don't know how to get rid of the possible NPE 
here without adding synchronization.
   
   The NPE will be just an annoyance since it's closing anyway.. but I was 
asked to mitigate the NPE.





Issue Time Tracking
---

Worklog Id: (was: 919604)
Time Spent: 40m  (was: 0.5h)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919579=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919579
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 15/May/24 18:22
Start Date: 15/May/24 18:22
Worklog Time Spent: 10m 
  Work Description: tabish121 commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1602074233


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   That would make more sense as the closed indicator is the only volatile in 
the mix and would generally convey the state in a timely manner.  Copying the 
other resources local is fine but doesn't pass a barrier so they still aren't 
the best indicator of closedness.





Issue Time Tracking
---

Worklog Id: (was: 919579)
Time Spent: 0.5h  (was: 20m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-15 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919571=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919571
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 15/May/24 17:12
Start Date: 15/May/24 17:12
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on code in PR #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932#discussion_r1601973117


##
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java:
##
@@ -170,16 +170,26 @@ private void resume() {
}
 
private void tryDelivering() {
+
+  final Delivery localDelivery = delivery;
+  final MessageReference localReference = reference;
+  final LargeBodyReader localBodyReader = largeBodyReader;
+
+  if (localDelivery == null || localReference == null || localBodyReader 
== null) {
+ logger.debug("Write got closed before tryDelivering was called");
+ return;
+  }

Review Comment:
   Cant we just check 'closed' here instead of all these changes and checks?





Issue Time Tracking
---

Worklog Id: (was: 919571)
Time Spent: 20m  (was: 10m)

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4771) NPE between AMQPLargeMessageWriter::tryDelivering and resetClose

2024-05-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4771?focusedWorklogId=919109=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-919109
 ]

ASF GitHub Bot logged work on ARTEMIS-4771:
---

Author: ASF GitHub Bot
Created on: 13/May/24 13:39
Start Date: 13/May/24 13:39
Worklog Time Spent: 10m 
  Work Description: clebertsuconic opened a new pull request, #4932:
URL: https://github.com/apache/activemq-artemis/pull/4932

   (no comment)




Issue Time Tracking
---

Worklog Id: (was: 919109)
Remaining Estimate: 0h
Time Spent: 10m

> NPE between AMQPLargeMessageWriter::tryDelivering and resetClose
> 
>
> Key: ARTEMIS-4771
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4771
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Clebert Suconic
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> This is using RedHat's bits:
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.qpid.proton.engine.Delivery.getTag()" because "this.delivery" is 
> null
> at 
> org.apache.activemq.artemis.protocol.amqp.proton.AMQPLargeMessageWriter.tryDelivering(AMQPLargeMessageWriter.java:174)
>  ~[artemis-amqp-protocol-2.33.0.redhat-9.jar:2.33.0.redhat-9]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
>  ~[netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) 
> [netty-transport-classes-epoll-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
>  [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
> [netty-common-4.1.108.Final-redhat-1.jar:4.1.108.Final-redhat-1]
> at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
>  [artemis-commons-2.33.0.redhat-9.jar:2.33.0.redhat-9]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)