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

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

                Author: ASF GitHub Bot
            Created on: 19/Jun/19 07:09
            Start Date: 19/Jun/19 07:09
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on pull request #2707: ARTEMIS-2002 
Proton transport objects leaked
URL: https://github.com/apache/activemq-artemis/pull/2707#discussion_r295146095
 
 

 ##########
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
 ##########
 @@ -389,13 +408,15 @@ public void onRemoteOpen(Connection connection) throws 
Exception {
       initialise();
 
       /*
-      * This can be null which is in effect an empty map, also we really don't 
need to check this for in bound connections
-      * but its here in case we add support for outbound connections.
-      * */
+       * This can be null which is in effect an empty map, also we really 
don't need to check this for in bound connections
+       * but its here in case we add support for outbound connections.
+       * */
       if (connection.getRemoteProperties() == null || 
!connection.getRemoteProperties().containsKey(CONNECTION_OPEN_FAILED)) {
          long nextKeepAliveTime = handler.tick(true);
-         if (nextKeepAliveTime != 0 && scheduledPool != null) {
-            scheduledPool.schedule(new ScheduleRunnable(), (nextKeepAliveTime 
- TimeUnit.NANOSECONDS.toMillis(System.nanoTime())), TimeUnit.MILLISECONDS);
+         synchronized (schedulingLock) {
+            if (nextKeepAliveTime != 0 && scheduledPool != null && 
!isSchedulingCancelled) {
+               scheduledFuture = scheduledPool.schedule(new 
ScheduleRunnable(), (nextKeepAliveTime - 
TimeUnit.NANOSECONDS.toMillis(System.nanoTime())), TimeUnit.MILLISECONDS);
 
 Review comment:
   Why not declaring `scheduledFuture` an `AtomicReference<ScheduledFuture<?>>` 
instead and avoid locks here?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

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

> Proton transport objects leaked if client disconnects abruptly leading to 
> OutOfMemoryError: Java heap space
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2002
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2002
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP
>    Affects Versions: 2.6.2
>            Reporter: Keith Wall
>            Priority: Major
>         Attachments: ARTEMIS-2002-OOMEHeap-ProtonObjectsLeaked.png
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> If an AMQP client with an attached receiving link disconnects abruptly (i.e. 
> closes socket without sending the AMQP close performative), {{TransportImpl}} 
> and other Proton class instances remain referenced within the heap.  If many 
> such clients do this, an OutOfMemoryError: Java heap space occurs.  This 
> occurs even though the underlying socket connection has been closed.
> I have reproduced this issue against both 2.6.2 and master 
> (f0c13622ac7e821a81a354b0242ef5235b6e82df).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to