Bug 51641 - Http11NioProcessor not correct release
Summary: Http11NioProcessor not correct release
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Connectors (show other bugs)
Version: trunk
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
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?