Created attachment 830235 [details]
Description of problem:
JBossWeb threads keep running after :reload, even though the subsystem is stopped successfully.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Start EAP
2. Invoke :reload via the CLI several times
3. Look at the number of running threads named "http-/127.0.0.1:8080-*" via jstack
I have this automated in the repro.sh script (see attachment).
The number of threads keeps rising during the test.
The number of threads is still the same during the test.
I looked into the implementation of JBossWeb and I believe I fixed the problem. Attaching a patch for the org.apache.tomcat.util.net.JIoEndpoint class -- note that this totally needs review, as I'm not familiar with the codebase. Also note that similar patch might be needed for NioEndpoint and maybe others, not sure.
Created attachment 830236 [details]
Very good catch, it would leak 2 or 3 threads depending on the connector. Obviously it was a bit hard to notice.
I applied something like your patch (for all connectors).
Closing as duplicate as it is about the same issue as in BZ#1032552
*** This bug has been marked as a duplicate of bug 1032552 ***