From d510547deb6a2e32e57bbb1ff1d8c775ef56c5b2 Mon Sep 17 00:00:00 2001 From: aefimov Date: Fri, 4 Apr 2014 14:58:04 +0400 Subject: [PATCH] 8029073: (corba) New connection reclaimed when number of connection is greater than highwatermark Reviewed-by: coffeys --- .../se/impl/transport/SocketOrChannelAcceptorImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java b/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java index e5fb14c..18023b5 100644 --- a/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java +++ b/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java @@ -253,6 +253,13 @@ public class SocketOrChannelAcceptorImpl // registered with the selector. Otherwise if the bytes // are read on the connection it will attempt a time stamp // but the cache will be null, resulting in NPE. + + // A connection needs to be timestamped before putting to the cache. + // Otherwise the newly created connection (with 0 timestamp) could be + // incorrectly reclaimed by concurrent reclaim() call OR if there + // will be no events on this connection then it could be reclaimed + // by upcoming reclaim() call. + getConnectionCache().stampTime(connection); getConnectionCache().put(this, connection); if (connection.shouldRegisterServerReadEvent()) { -- GitLab