tomcat7 in ubuntu trusty is affected by the '50 days timeout bug' when run by the Oracle JDK 7
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Tomcat7 |
Fix Released
|
High
|
|||
tomcat7 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
After 2^32 milliseconds from the startup, tomcat fails with the following error:
ERROR [core.StandardS
java.net.
at java.net.
at java.net.
at java.net.
at java.net.
at org.apache.
at org.apache.
at org.apache.
at sun.reflect.
at sun.reflect.
at sun.reflect.
at java.lang.
at org.apache.
at org.apache.
It has been solved in tomcat 7.0.55, and the bug is: https:/
Changed in tomcat7: | |
importance: | Unknown → High |
status: | Unknown → Fix Released |
After upgrading to Java 7, I've noticed some applications fail after about 50 days f (for instance May 8 till June 27). This is suspiciously close to 2 ^ 32 -1 milliseconds:
Jun 27, 2014 9:24:47 AM org.apache. catalina. core.StandardSe rver await await: accept: SocketTimeoutEx ception: Accept timed out PlainSocketImpl .socketAccept( Native Method) AbstractPlainSo cketImpl. accept( AbstractPlainSo cketImpl. java:398) ServerSocket. implAccept( ServerSocket. java:530) ServerSocket. accept( ServerSocket. java:498) catalina. core.StandardSe rver.await( StandardServer. java:431) catalina. startup. Catalina. await(Catalina. java:676) catalina. startup. Catalina. start(Catalina. java:628) NativeMethodAcc essorImpl. invoke0( Native Method) NativeMethodAcc essorImpl. invoke( NativeMethodAcc essorImpl. java:57) DelegatingMetho dAccessorImpl. invoke( DelegatingMetho dAccessorImpl. java:43) reflect. Method. invoke( Method. java:606) catalina. startup. Bootstrap. start(Bootstrap .java:289) catalina. startup. Bootstrap. main(Bootstrap. java:414) coyote. http11. Http11AprProtoc ol pause coyote. ajp.AjpAprProto col pause catalina. core.StandardSe rvice stop
SEVERE: StandardServer.
java.net.
at java.net.
at java.net.
at java.net.
at java.net.
at org.apache.
at org.apache.
at org.apache.
at sun.reflect.
at sun.reflect.
at sun.reflect.
at java.lang.
at org.apache.
at org.apache.
Jun 27, 2014 9:24:47 AM org.apache.
INFO: Pausing Coyote HTTP/1.1 on http-51080
Jun 27, 2014 9:24:47 AM org.apache.
INFO: Pausing Coyote AJP/1.3 on ajp-51009
Jun 27, 2014 9:24:48 AM org.apache.
INFO: Stopping service Catalina
After this, the application is no longer listening.
I suspect this may be due to a change in behavior in Java. See:
$ $JAVA_HOME/bin/java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
$ strace -f -o /tmp/hh groovy -e 'new ServerSocket(60001, 1, InetAddress. getByName( "localhost" )).accept( )' AF_INET6, sin6_port= htons(60001) , inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0 POLLIN| POLLERR} ], 1, 4294967295 <unfinished ...>
File contains:
2212 bind(47, {sa_family=
2212 listen(47, 1) = 0
2212 poll([{fd=47, events=
$ $JAVA_HOME/bin/java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
2661 bind(46, {sa_family= AF_INET6, sin6_port= htons(60001) , inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
2661 listen(46, 1) = 0
2661 accept(46, <unfinished ...>
While java6 calls accept(), java7 first waits for an event on the socket with poll(). However, it uses a timeout of 4294967295 milliseconds.