You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2011/04/06 13:02:49 UTC

DO NOT REPLY [Bug 51030] New: Way to terminate CGI immediatly after closing connection

https://issues.apache.org/bugzilla/show_bug.cgi?id=51030

           Summary: Way to terminate CGI immediatly after closing
                    connection
           Product: Apache httpd-2
           Version: 2.2.14
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cgi
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: gogh@rambler.ru


As I understood there is only two mechanisms for CGI killing after colsing
connection with client:
1. Waiting for Timeout seconds and sending CIGTERM to cgi process.
2. Waiting for SIGPIPE after cgi process trying to write to STDOUT.

There is no way to terminate long-thinking cgi-process while performing
long-term queries to SQL. But there is no reason to wait for query finishing
while client no more waiting for cgi response.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51030] Way to terminate CGI immediatly after closing connection

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51030

William A. Rowe Jr. <wr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
            Version|2.2.14                      |2.3-HEAD
         OS/Version|Linux                       |All
           Severity|normal                      |enhancement

--- Comment #1 from William A. Rowe Jr. <wr...@apache.org> 2011-04-06 13:21:34 EDT ---
And your proposed new way is ... ?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51030] Way to terminate CGI immediatly after closing connection

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51030

--- Comment #2 from Maxim <go...@rambler.ru> 2011-04-06 14:29:53 EDT ---
There is no need to wait until Timeout when connection is already closed. It is
worth to send SIGTERM to cgi-process immediately after closing connection with
client. Isn't it?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51030] Way to terminate CGI immediatly after closing connection

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51030

Maxim <go...@rambler.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gogh@rambler.ru

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51030] Way to terminate CGI immediatly after closing connection

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51030

--- Comment #5 from Joe Orton <jo...@redhat.com> 2011-04-08 07:55:08 EDT ---
This is not possible without completely redesigning the filter architecture;
you need to poll across all of (socket, CGI stdout, CGI stderr) to be able to
detect the TCP connnection closure from the client.  i.e. RESOLVED->WONTFIX.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51030] Way to terminate CGI immediatly after closing connection

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51030

Maxim <go...@rambler.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51030] Way to terminate CGI immediatly after closing connection

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51030

--- Comment #4 from Maxim <go...@rambler.ru> 2011-04-08 05:49:49 EDT ---
(In reply to comment #3)
> So to summarize, you would suggest;
> 
>  1. send SIGTERM immediately
> 
>  2. after timeout, send SIGKILL
> 
> Is that what you are suggesting?
> 
> As it can be harmful to some applications, I can only foresee this being
> adopted as a per-dir (per specific <files > match) feature.  Also be aware that
> httpd may not be aware until httpd attempts to send data that the remote
> connection is AWOL, so this would be far from a perfect solution

Not exactly... I mean the only situations when you precisely know that client
leave (by pressing 'cancel browsing', for example), consequently there is no
need to wait untill Timeout (cause nobody waits cgi-script output), and it
would be good to inform cgi-script somehow about this to force it stopping some
hard job (cause no one need the results of it) or some other finishing. Why not
perfect? In opposite it'll be very usefull. Of cause it should be configurable
per-dir behaviour.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 51030] Way to terminate CGI immediatly after closing connection

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51030

--- Comment #3 from William A. Rowe Jr. <wr...@apache.org> 2011-04-08 01:49:10 EDT ---
So to summarize, you would suggest;

 1. send SIGTERM immediately

 2. after timeout, send SIGKILL

Is that what you are suggesting?

As it can be harmful to some applications, I can only foresee this being
adopted as a per-dir (per specific <files > match) feature.  Also be aware that
httpd may not be aware until httpd attempts to send data that the remote
connection is AWOL, so this would be far from a perfect solution

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org