You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by jo...@apache.org on 2019/02/06 20:39:19 UTC

[mina] branch 2.0 updated: While investigating DIRMINA-1086, I found a exception handling flaw which allows fired captured exceptions to occur after the last clearWriteRequestQUeue call. This could cause a memmory leak when caught excpetions create WriteRequests.

This is an automated email from the ASF dual-hosted git repository.

johnnyv pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/mina.git


The following commit(s) were added to refs/heads/2.0 by this push:
     new 2d7d595  While investigating DIRMINA-1086, I found a exception handling flaw which allows fired captured exceptions to occur after the last clearWriteRequestQUeue call.  This could cause a memmory leak when caught excpetions create WriteRequests.
2d7d595 is described below

commit 2d7d595e4c0a7bb6eeb5a721954ba13fb9d7f811
Author: jvalliere <jo...@emoten.com>
AuthorDate: Wed Feb 6 15:37:48 2019 -0500

    While investigating DIRMINA-1086, I found a exception handling flaw
    which allows fired captured exceptions to occur after the last
    clearWriteRequestQUeue call.  This could cause a memmory leak when
    caught excpetions create WriteRequests.
---
 .../java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java b/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java
index 78807ee..5fe4ca1 100644
--- a/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java
+++ b/mina-core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java
@@ -1157,7 +1157,6 @@ public abstract class AbstractPollingIoProcessor<S extends AbstractIoSession> im
                 filterChain.fireExceptionCaught(e);
             } finally {
                 try {
-                    clearWriteRequestQueue(session);
                     ((AbstractIoService) session.getService()).getListeners().fireSessionDestroyed(session);
                 } catch (Exception e) {
                     // The session was either destroyed or not at this point.
@@ -1166,6 +1165,8 @@ public abstract class AbstractPollingIoProcessor<S extends AbstractIoSession> im
                     // the return value by bubbling up.
                     IoFilterChain filterChain = session.getFilterChain();
                     filterChain.fireExceptionCaught(e);
+                } finally {
+                    clearWriteRequestQueue(session);
                 }
             }