【问题标题】:Dancer randomly hangs when reading GET request阅读 GET 请求时 Dancer 随机挂起
【发布时间】:2013-04-13 12:33:52
【问题描述】:

我在 Linux 上玩 perl dancer,如果浏览器直接通过 LAN 连接到服务器,一切都很好。但是,当我通过 WAN 连接 并且 浏览器是 IE9 时,偶尔繁忙的光标不会消失。

我可以通过连续重新加载页面 apx 10 次来引发这种情况。即使我在每次重新加载之间等待几秒钟,我也会遇到这个问题。页面本身非常简单,并且通过了 w3c 检查。

如果我以root身份运行dancer,或者端口是80还是3000都没有区别。A还测试了使用apache频繁重新加载页面,似乎没有问题。

我运行了 strace,我的印象是,请求数据有时在 dancer 尝试读取它时不可用。这就是跟踪的样子

什么时候起作用:

{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

当它挂起时

{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, 

然后它就永远存在了。知道我能做什么吗?

【问题讨论】:

    标签: linux perl internet-explorer internet-explorer-9 dancer


    【解决方案1】:

    我遇到了similar problem,IE9 连接到 Catalyst 开发服务器。 Eric Lawrence(IE 团队负责人!?)认为这可能是由于 IE9 的后台连接功能。 IE9 会打开一个后台 TCP 连接以加快对服务器的未来请求,但这显然会导致单线程服务器出现问题。如果你正在运行 Dancer 的默认开发服务器 (HTTP::Server::Simple::PSGI),you won't be able to handle IE9

    我通过 Apache 代理解决了这个问题。这让开发变得更加麻烦,但仅限于我必须测试 IE9 时。

    【讨论】:

    • 我还看到 IE9 锁定了在 Plack 下使用 HTTP::Server::Simple 运行的 Dancer。我的临时解决方案是使用 Firefox,而我的长期解决方案是在某个时候使用带有 Plack 的高端 Web 服务器。 Dancer 为不同的 Web 服务器(例如 nginx)提供配置文档 - 类似于 @wes 的解决方案。
    • @wes 我把 dancer 放在 apache 后面,一切似乎都很好。谢谢
    猜你喜欢
    • 2021-12-23
    • 2021-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-21
    相关资源
    最近更新 更多