You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Torsten Foertsch <to...@gmx.net> on 2005/05/06 14:12:52 UTC
modperl and the TCP_DEFER_ACCEPT-patch for linux
Hi,
yesterday I have patched my apache with this patch and now I have noticed that
testing mod_perl hangs in t/protocol/pseudo_http. The reason is simple and to
be expected. t/protocol/pseudo_http tests a protocol module that is greeting
the client with "HELO" before receiving any data. Since the patch prevents
accept(2) from returning before data has been received from the client the
connection is not accepted. Hence no piece of code gets chance to send
"HELO".
Maybe it is worth to change the test so that the client must send someting at
first?
I could provide a patch.
Torsten
Re: modperl and the TCP_DEFER_ACCEPT-patch for linux
Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
[...]
>>> This workaround doesn't sound right. A protocol handler (server) must be
>>> able to start the conversation first. If not, many protocols relying on
>>> the server's greeing (e.g. SMTP) won't work. e.g., see:
>>> http://www.samlogic.net/articles/smtp.htm
>>
>>
>>
>> I know that it would break some protocols. It can be accepted to
>> httpd-2.0 only if it is configurable. I was asking whether testing
>> mod_perl should rely on the server's ability to send data first.
>
>
> It shouldn't be in Apache-2 at all, I've posted an email to httpd-dev
> regarding this issue.
Quoting Paul Querna at httpd-dev:
Yes, I know this is broken, thats why I made the listen-protocol
branch to solve this exact issue.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: modperl and the TCP_DEFER_ACCEPT-patch for linux
Posted by Stas Bekman <st...@stason.org>.
Torsten Foertsch wrote:
> On Saturday 07 May 2005 08:30, Stas Bekman wrote:
>
>>Torsten Foertsch wrote:
>>
>>>Hi,
>>>
>>>yesterday I have patched my apache with this patch and now I have noticed
>>>that testing mod_perl hangs in t/protocol/pseudo_http. The reason is
>>>simple and to be expected. t/protocol/pseudo_http tests a protocol module
>>>that is greeting the client with "HELO" before receiving any data. Since
>>>the patch prevents accept(2) from returning before data has been received
>>>from the client the connection is not accepted. Hence no piece of code
>>>gets chance to send "HELO".
>>>
>>>Maybe it is worth to change the test so that the client must send
>>>someting at first?
>>>
>>>I could provide a patch.
>>
>>What's that patch you are talking about, Torsten?
>
>
> Sorry for not providing a link. Here it is:
> http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=111523765005281&w=2
Ah, thanks Torsten, I have lots of emails to catch up with.
> The whole thing came from a discussion about the Timeout configuration
> directive, see
> http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=111513459203781&w=2
>
> One proposed solution was to enable BSD accept-filtering. Thus, accept(2) will
> return only if a complete HTTP-request is ready to be read. For Linux a
> similar mechanism exists with the TCP_DEFER_ACCEPT socket option. According
> to the thread Apache 2.1 uses this option. Then a backport was suggested
> resulting in the patch.
Do you get the same problem when testing with httpd-2.1? I didn't try
recently, was it a recent change in 2.1 too?
>>This workaround doesn't sound right. A protocol handler (server) must be
>>able to start the conversation first. If not, many protocols relying on
>>the server's greeing (e.g. SMTP) won't work. e.g., see:
>>http://www.samlogic.net/articles/smtp.htm
>
>
> I know that it would break some protocols. It can be accepted to httpd-2.0
> only if it is configurable. I was asking whether testing mod_perl should rely
> on the server's ability to send data first.
It shouldn't be in Apache-2 at all, I've posted an email to httpd-dev
regarding this issue.
> If not, the attached patch changes slightly the protocol initialization. Now
> the client should send "HELO". The server replies "Nice to meet you".
No, this is wrong. The test is written to test the functionality not to
have 100% pass.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: modperl and the TCP_DEFER_ACCEPT-patch for linux
Posted by Torsten Foertsch <to...@gmx.net>.
On Saturday 07 May 2005 08:30, Stas Bekman wrote:
> Torsten Foertsch wrote:
> > Hi,
> >
> > yesterday I have patched my apache with this patch and now I have noticed
> > that testing mod_perl hangs in t/protocol/pseudo_http. The reason is
> > simple and to be expected. t/protocol/pseudo_http tests a protocol module
> > that is greeting the client with "HELO" before receiving any data. Since
> > the patch prevents accept(2) from returning before data has been received
> > from the client the connection is not accepted. Hence no piece of code
> > gets chance to send "HELO".
> >
> > Maybe it is worth to change the test so that the client must send
> > someting at first?
> >
> > I could provide a patch.
>
> What's that patch you are talking about, Torsten?
Sorry for not providing a link. Here it is:
http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=111523765005281&w=2
The whole thing came from a discussion about the Timeout configuration
directive, see
http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=111513459203781&w=2
One proposed solution was to enable BSD accept-filtering. Thus, accept(2) will
return only if a complete HTTP-request is ready to be read. For Linux a
similar mechanism exists with the TCP_DEFER_ACCEPT socket option. According
to the thread Apache 2.1 uses this option. Then a backport was suggested
resulting in the patch.
> This workaround doesn't sound right. A protocol handler (server) must be
> able to start the conversation first. If not, many protocols relying on
> the server's greeing (e.g. SMTP) won't work. e.g., see:
> http://www.samlogic.net/articles/smtp.htm
I know that it would break some protocols. It can be accepted to httpd-2.0
only if it is configurable. I was asking whether testing mod_perl should rely
on the server's ability to send data first.
If not, the attached patch changes slightly the protocol initialization. Now
the client should send "HELO". The server replies "Nice to meet you".
Torsten
Re: modperl and the TCP_DEFER_ACCEPT-patch for linux
Posted by Stas Bekman <st...@stason.org>.
Torsten Foertsch wrote:
> Hi,
>
> yesterday I have patched my apache with this patch and now I have noticed that
> testing mod_perl hangs in t/protocol/pseudo_http. The reason is simple and to
> be expected. t/protocol/pseudo_http tests a protocol module that is greeting
> the client with "HELO" before receiving any data. Since the patch prevents
> accept(2) from returning before data has been received from the client the
> connection is not accepted. Hence no piece of code gets chance to send
> "HELO".
>
> Maybe it is worth to change the test so that the client must send someting at
> first?
>
> I could provide a patch.
What's that patch you are talking about, Torsten?
This workaround doesn't sound right. A protocol handler (server) must be
able to start the conversation first. If not, many protocols relying on
the server's greeing (e.g. SMTP) won't work. e.g., see:
http://www.samlogic.net/articles/smtp.htm
If Apache is trying to change that behavior, it seems to be like a wrong
decision. Do you have a pointer to where this change was introduced?
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org