Bug 51641 - Http11NioProcessor not correct release
Http11NioProcessor not correct release
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Connectors
trunk
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-08-10 03:37 UTC by zhh
Modified: 2011-08-10 11:44 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhh 2011-08-10 03:37:44 UTC
org.apache.coyote.http11.Http11NioProtocol.Http11ConnectionHandler

code segment:
==================================
        @Override
        public void release(SocketWrapper<NioChannel> socket) {
            Http11NioProcessor processor = connections.remove(socket);
            if (processor != null) {
                processor.recycle();
                recycledProcessors.offer(processor);
            }
        }
==================================

should be:
==================================
        @Override
        public void release(SocketWrapper<NioChannel> socket) {
            Http11NioProcessor processor = connections.remove(socket.getSocket());
            if (processor != null) {
                processor.recycle();
                recycledProcessors.offer(processor);
            }
        }
==================================

type of connections is ConcurrentHashMap<NioChannel, Http11NioProcessor> ,
not ConcurrentHashMap<SocketWrapper<NioChannel>, Http11NioProcessor>.
Comment 1 Mark Thomas 2011-08-10 11:44:27 UTC
Thanks for the report. This has been fixed in trunk and 7.0.x.

I couldn't see a way to trigger this in normal operation. Did you see a memory leak due to this or did you find it some other way?