New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lots of "Software caused connection abort" messages appearing in apache log #119
Comments
|
Our error log (3.2.7) is also full of these errors. Apache is 2.2.7 on RHEL5 64bit. |
|
Can you try changing the regexp (remove the '^'). I think EPrints should suppress these messages from the log but the On 13/08/13 01:01, Mark Gregson wrote:
Timothy Miles-Board |
|
Is masking these the right option under all circumstances? I’ve noticed them in our logs too, but never got to the bottom of whether I should be concerned about them… From: Tim Miles-Board [mailto:notifications@github.com] Can you try changing the regexp (remove the '^'). I think EPrints should suppress these messages from the log but the On 13/08/13 01:01, Mark Gregson wrote:
Timothy Miles-Board — |
|
Same problem appears in perl_lib/EPrints/Page/Text.pm in 3.2: 60 eval { print $self->{page_text}; };
61 if( $@ && $@ !~ m/^Software caused connection abort/ )
62 {
63 EPrints::abort( "Error in send_page: $@" );
64 } |
|
Page.pm also throws that error on 3.3 if( $@ !~ m/^Software caused connection abort/ )
{
EPrints::abort( "Error in send_page: $@" );
}
else
{
die $@;
}
But anyway, which behaviour would you like to see here? This error is caused by the client closing the socket so it doesn't seem to be a major problem. |
|
As I said, I never understood whether I should be worried about these or not. If it’s always caused by a client closing the socket, yes, throw it away. If it’s always a useless error, why is it generated? Cheers, From: Sebastien Francois [mailto:notifications@github.com] Page.pm also throws that error on 3.3 But anyway, which behaviour would you like to see here? This error is caused by the client closing the socket so it doesn't seem to be a major problem. — |
|
It's generated when apache tries to write to a connection that's already EPrints does the right thing - if when writing to a connection the The bug is that it is not in fact silent because the regexp does not So fix as far as I can see is just to remove the '^' from the regexp in On 13/08/13 11:50, jesusbagpuss wrote:
Timothy Miles-Board |
|
Note that in 3.3, Page.pm will throw that error, always: either via EPrints::abort() or via die(). My understanding is that code execution must stop if the page isn't successfully sent to the client for whatever reason. |
|
Hi, I suspect that correcting or rather suppressing this error at logging level is not quite sufficient on a larger scale. The callback routine in said Storage.pm module is just sub { print $[0] }, but what can $[0] be? Can it be a whole PDF stream of, say, some hundreds of megabytes? If that is the case, syswrite() instead of print() approach seems preferable to me since it would write $buffersize bytes at once only, thus it would be less data the system tries to write to a socket suddenly closed, enabling apache to destroy the invalidated response sooner and to be, in the end, more responsive when exposed to parallelized downloading, badly designed crawlers and alike. |
|
By default it would be Plugin::Storage::Local::retrieve running the following: my $buffer;
my $bsize = $n > 65536 ? 65536 : $n;
while(sysread($fh,$buffer,$bsize))
{
$rc &&= &$f($buffer);
last unless $rc;
$f = sub { print $[0] } so $[0] is $buffer above, enclosed in a sysread with default read size of 64kb. So the behaviour seems correct i.e. it won't try to write to a closed socket. |
|
Hi, thank you for replaying so soon, but then is STDOUT binmode and/or autoflushing ($|=1)? As far as i know, print is buffering internally as well to flush not until newline, so simply subsequent print() would be of no avail. But in modperl environment, autoflush might well be on by default, dunno. |
|
Wouldn't print's buffer flush when the sub {} it's enclosed in returns? Cos the code isn't: while() {
print $CHUNK;
}
but while() {
&sub{ print $CHUNK; }
}
|
|
No, that doesn't matter. |
Related to eprints#119
We are correctly trapping the client abort in an eval {} but I think the error message from apache has changed in recent versions / is different is some versions?
eg - Apache 2.2.22-1ubuntu1.4 message is:
:Apache2 IO write: (103) Software caused connection abort at [...]
which won't match the regexp in Apache::Storage::handler():
The text was updated successfully, but these errors were encountered: