We're updating the issue view to help you get more done. 

Container.stop() does not properly wait for server shutdown

Description

The stop() invocation does not always properly wait for the complete shutdown of the server. This results in random CI failure for Tomcat 4.x and some hard-coded Thread.sleeep(5000) calls in other containers to mitigate the issue.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Starting service Tomcat-Standalone Apache Tomcat/4.1.40 java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.<init>(ServerSocket.java:185) at java.net.ServerSocket.<init>(ServerSocket.java:141) at org.apache.catalina.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:101) at org.apache.ajp.tomcat4.Ajp13Connector.open(Ajp13Connector.java:775) at org.apache.ajp.tomcat4.Ajp13Connector.start(Ajp13Connector.java:1026) at org.apache.catalina.core.StandardService.start(StandardService.java:459) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2213) at org.apache.catalina.startup.Catalina.start(Catalina.java:484) at org.apache.catalina.startup.Catalina.execute(Catalina.java:371) at org.apache.catalina.startup.Catalina.process(Catalina.java:134) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:151)

Status

Assignee

Benjamin Bentmann

Reporter

Benjamin Bentmann

Components

Fix versions

Affects versions

1.0.6

Priority

Minor