Dancer accidentally freezes while reading GET request

I play with a Perl dancer on Linux, and all is well and dany if the browser connects to the server directly via LAN. However, when I connect through the WAN and the browser is IE9, sometimes the busy cursor does not go away because of this.

I can provoke this by reloading the apx page 10 times in a row. I get this problem even when I wait a few seconds between each reboot. The page itself is terribly simple and passes the w3c check.

It doesn’t matter if I run dancer as root or port 80 or 3000. It also checks for frequent page reloads using apache, and there seems to be no problem.

I worked with strace, and I got the impression that the request data is sometimes not available at the moment when the dancer tries to read it. This is what the trace looks like

When it works:

{sa_family=AF_INET, sin_port=htons(52073), sin_addr=inet_addr("78.42.213.92")}, [16]) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfab5028) = -1 ENOTTY (Inappropriate ioctl for device)
_llseek(4, 0, 0xbfab5070, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfab5028) = -1 ENOTTY (Inappropriate ioctl for device)
_llseek(4, 0, 0xbfab5070, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
getpeername(4, {sa_family=AF_INET, sin_port=htons(52073), sin_addr=inet_addr("78.42.213.92")}, [16]) = 0
read(4, "G", 1)                         = 1
read(4, "E", 1)                         = 1
read(4, "T", 1)                         = 1

When it freezes

{sa_family=AF_INET, sin_port=htons(52225), sin_addr=inet_addr("78.42.213.92")}, [16]) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfab5028) = -1 ENOTTY (Inappropriate ioctl for device)
_llseek(4, 0, 0xbfab5070, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfab5028) = -1 ENOTTY (Inappropriate ioctl for device)
_llseek(4, 0, 0xbfab5070, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
getpeername(4, {sa_family=AF_INET, sin_port=htons(52225), sin_addr=inet_addr("78.42.213.92")}, [16]) = 0
read(4, 

and then he sits forever. Any idea what I can do?

+5
source share
1 answer

I ran into a similar problem connecting IE9 to the Catalyst dev server. Eric Lawrence (IE Team Leader!) Suggested this might be due to the IE9 connectivity feature. IE9 opens a TCP background connection to speed up future server requests, but this obviously causes problems for single-threaded servers. If you are using Dancer default dev server (HTTP :: Server :: Simple :: PSGI), you will not be able to handle IE9 .

, Apache. , , IE9.

+4

All Articles