Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005203 [Resin] major always 08-31-12 05:19 08-31-12 11:03
Reporter ssmax View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.31 Product Version 4.0.29
  Product Build
Summary 0005203: mod_caucho.so make wrong socket timeout in linux
Description resin pro 4.0.29 --enable-64bit --enable-jni --with-apxs=...
jdk: oracle java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)
apache: 2.2.4 / 2.2.22
os: centos 5.8 final
kernel: 2.6.18-308.1.1.el5 / 2.6.18-308.13.1.el5 / etc..

when use resin as a srun server behind apache httpd, every pages that load over 5 seconds in resin will lead to a 503 reponse in apache.

i use an old version mod_caucho.so (4.0.24) to replcace the new one , and keep it connect to the new resin ( 4.0.29 ), it works fine.

after a long time trace, i found some new code in 4.0.29:

resin-pro-4.0.29/modules/c/src/common/stream.c

#define WINDOWS_READ_TIMEOUT 3600
...
  srun->read_timeout = WINDOWS_READ_TIMEOUT;
...

#ifdef HAS_SOCK_TIMEOUT
  timeout.tv_sec = srun->read_timeout / 1000;
  timeout.tv_usec = srun->read_timeout % 1000 * 1000;

  setsockopt(s->socket, SOL_SOCKET, SO_RCVTIMEO,
             (char *) &timeout, sizeof(timeout));

  timeout.tv_sec = srun->read_timeout / 1000;
  timeout.tv_usec = srun->read_timeout % 1000 * 1000;
  setsockopt(s->socket, SOL_SOCKET, SO_SNDTIMEO,
             (char *) &timeout, sizeof(timeout));
#endif



i think srun->read_timeout should be used for windows here , stands for one hour(3600 seconds).

but when compile the code in linux, the flag HAS_SOCK_TIMEOUT is defined.
so the code will stop all response which write first byte after 3.6 seconds.

i try to modify srun->read_timeout to a bigger value , and recompile it , then everything goes right.

there are some bugs in the recent update of resin , i think you guys should care more about the part of c code....
Steps To Reproduce
Additional Information
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
08-31-12 05:19 ssmax New Issue
08-31-12 11:03 ferg Assigned To  => ferg
08-31-12 11:03 ferg Status new => closed
08-31-12 11:03 ferg Resolution open => fixed
08-31-12 11:03 ferg Fixed in Version  => 4.0.31


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
27 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker