# HG changeset patch # User aefimov # Date 1396609084 -14400 # Node ID 693525eeea859e20a9d22405d375161750082ad2 # Parent 4e4a75376185ca1a712cc9fef5a340e6927cf5e2 8029073: (corba) New connection reclaimed when number of connection is greater than highwatermark Reviewed-by: coffeys diff -r 4e4a75376185 -r 693525eeea85 src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java --- a/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java Wed Mar 26 12:00:38 2014 -0700 +++ b/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java Fri Apr 04 14:58:04 2014 +0400 @@ -253,6 +253,13 @@ // 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()) {