“超过未决信号的最大计数(120)”是什么意思?意思是?
我的 Perl Web 应用程序在 Apache mod_fastcgi 下运行,经常出现如下错误 下列的:
第 119 行超出了待处理信号的最大数量 (120)。
我已经看到这种情况与文件上传有关,但我不确定是否是这样 唯一一次它发生。在出现该错误之前(或可能之后),我还会收到 SIGPIPE。
有什么想法吗?
编辑感谢大家的建议。有人问119行是什么。抱歉,应该把它放进去。它位于我对上传的文件运行病毒检查程序的代码块中。我并不是每次都会出现这个错误,只是偶尔出现。
if(open VIRUS_CK, '|/usr/local/bin/clamscan - --no-summary >'.$tmp_file) {
print VIRUS_CK $data; // THIS IS LINE 119
close VIRUS_CK;
if (($? >> 8) == 1) {
open VIRUS_OUTPUT, '<'.$tmp_file;
my $vout = <VIRUS_OUTPUT>;
close VIRUS_OUTPUT;
$vout =~ s/^stdin:\s//;
$vout =~ s/FOUND$//;
print STDERR "virus found on upload: $vout\n";
return undef, 'could not accept attachment, virus found: '.$vout;
}
unlink($tmp_file);
}
My Perl web-app, running under Apache mod_fastcgi, frequently gets errors like the
following:
Maximal count of pending signals (120) exceeded at line 119.
I've seen this happen in relation to file uploads but I'm not sure that's
the only time it happens. I also get a SIGPIPE right before (or possibly after) I get that error.
Any thoughts?
EDIT Thanks for the suggestions everyone. Someone asked what line 119 was. Sorry, should have put that in. It's in a block of code where I run the virus checker on an uploaded file. I don't get the error every time, only occasionally.
if(open VIRUS_CK, '|/usr/local/bin/clamscan - --no-summary >'.$tmp_file) {
print VIRUS_CK $data; // THIS IS LINE 119
close VIRUS_CK;
if (($? >> 8) == 1) {
open VIRUS_OUTPUT, '<'.$tmp_file;
my $vout = <VIRUS_OUTPUT>;
close VIRUS_OUTPUT;
$vout =~ s/^stdin:\s//;
$vout =~ s/FOUND$//;
print STDERR "virus found on upload: $vout\n";
return undef, 'could not accept attachment, virus found: '.$vout;
}
unlink($tmp_file);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这意味着操作系统向 Perl 传递信号的速度超过了它处理信号的速度,并且已经达到了饱和点。在操作之间,Perl 保存要处理的信号,然后在有机会时处理它们。出现此错误是因为在 Perl 有机会喘口气之前收到了太多信号。这是一个致命错误,因此您的 Perl 进程将终止。
解决方案是找出产生如此多信号的原因。请参阅此处了解更多细节。
更新:我原来的答案有些不准确,我说生成新的 Perl 进程是问题的一部分,但事实上并非如此。我根据下面@ysth 的评论进行了更新。
It means that the operating system is delivering signals to Perl faster than it can handle them, and the saturation point has been reached. Between operations, Perl saves signals to be handled and then handles them once it has a chance. You get this error because too many signals were received before Perl had a chance to catch its breath. This is a fatal error, so your Perl process terminates.
The solution is to figure out what's generating so many signals. See here for more details.
Update: My original answer was somewhat inaccurate, saying that generating a new Perl process was part of the issue, when in fact it wasn't. I've updated based on @ysth's comment below.
我会手舞足蹈,因为我已经很长时间没有使用 mod_fastcgi 了,而且我已经有一段时间没有查看它的文档了。
我猜你的 Perl 模块是非分叉的,但需要一段时间才能运行,这样客户端关闭就需要一段时间来处理。请参阅 FastCGI Apache 模块 mod_fastcgi 下有关信号的注释FastCGI 使用的信号,以及程序可能希望如何处理这些信号,包括
SIGPIPE
。I'll be hand-wavy because I've not used mod_fastcgi in a long time, and it's has been a while since I've looked at its documentation.
I'm guessing that your Perl module is non-forking, but takes a while to run, such that client closes take a while to process. See Notes under FastCGI Apache module mod_fastcgi about Signals used by FastCGI, and how programs may wish to handle those signals, including
SIGPIPE
.