You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ivan Zhakov <ch...@gmail.com> on 2005/10/13 01:17:52 UTC

mpm_winnt incompatible and broken behavior on restart

Hi!
We have Apache/Subversion server under Windows Server 2003. And I was
come into problem with restarting server that process long request
(more than 180 seconds). It's usual for bug Subversion repository. I
see messages like this in error.log:
[Thu Oct 13 02:28:01 2005] [notice] Child 3952: Terminating 1 threads
that failed to exit.

I research problem and that mpm_winnt have hardcoded timeout for
stopping working threads:
http://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x/server/mpm/winnt/child.c:child_main()
/* Give busy worker threads a chance to service their connections */
    ap_log_error(APLOG_MARK,APLOG_NOTICE, APR_SUCCESS, ap_server_conf,
                 "Child %d: Waiting for %d worker threads to exit.",
my_pid, threads_created);
    end_time = time(NULL) + 180;
    while (threads_created) {
        rv = wait_for_many_objects(threads_created, child_handles,
end_time - time(NULL));
        if (rv != WAIT_TIMEOUT) {
            rv = rv - WAIT_OBJECT_0;
            ap_assert((rv >= 0) && (rv < threads_created));
            cleanup_thread(child_handles, &threads_created, rv);
            continue;
        }
        break;
    }

After this timeout Apache terminate worker threads. Why is it? Why
mpm_winnt behavior incompatible to perfork behavior which waits
infinityle for stopping child processes? It causes really problems on
maintance and also doesn't permit use MaxRequestsPerChild option.

PS: Sorry if it is not right place for such questions.

--
Ivan Zhakov

Re: mpm_winnt incompatible and broken behavior on restart

Posted by Jeff White <jl...@earthlink.net>.
Ivan Zhakov wrote:

> We have Apache/Subversion server
> under Windows Server 2003.

> From Bill Stoddard

> I think the few Win32 developers
> here (myself included) always had
> this on their list of 'todo's'. The
> Windows MPM needs to be enhanced
> to reliably support multiple child processes
> and when that's done, this will be fixed
> 'for free'.

Perhaps 'for free' see how IIS7
handles this or perhaps just host
the whole web server or just parts
of IIS7 within Apache or within any
other (perhaps Subversion) Windows
Vista process?

IIS 7.0 Beta:
IIS Hostable Web Core Reference
http://msdn.microsoft.com/library/en-us/IIS_70_WebExtSDK/html/d9d5406e-edef-ab14-c78a-711f70d5cda2.asp

IIS 7.0 Beta:
Internet Information Services (IIS) 7.0 SDK
http://msdn.microsoft.com/library/en-us/IIS_70_WebExtSDK/html/6c07a4d0-1bf0-45d3-8178-25df76e6740c.asp

IIS 7.0 Beta: IIS 7.0 Operations Guide (IIS 7.0 Beta 1)
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/iis7/Ops/9a90c800-3f09-4a3f-87b0-caae34076aca.mspx


Jeff



Re: mpm_winnt incompatible and broken behavior on restart

Posted by Ivan Zhakov <ch...@gmail.com>.
On 10/13/05, Bill Stoddard <bi...@wstoddard.com> wrote:
> Ivan Zhakov wrote:
> > Hi!We have Apache/Subversion server under Windows Server 2003. And I wascome into problem with restarting server that process long request(more than 180 seconds). It's usual for bug Subversion repository. Isee messages like this in error.log:[Thu Oct 13 02:28:01 2005] [notice] Child 3952: Terminating 1 threadsthat failed to exit.
> > I research problem and that mpm_winnt have hardcoded timeout forstopping working threads:http://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x/server/mpm/winnt/child.c:child_main()/* Give busy worker threads a chance to service their connections */    ap_log_error(APLOG_MARK,APLOG_NOTICE, APR_SUCCESS, ap_server_conf,                 "Child %d: Waiting for %d worker threads to exit.",my_pid, threads_created);    end_time = time(NULL) + 180;    while (threads_created) {        rv = wait_for_many_objects(threads_created, child_handles,end_time - time(NULL));        if (rv != WAIT_TIMEOUT) {            rv = rv - WAIT_OBJECT_0;            ap_assert((rv >= 0) && (rv < threads_created));            cleanup_thread(child_handles, &threads_created, rv);            continue;        }        break;    }
> > After this timeout Apache terminate worker threads. Why is it? Whympm_winnt behavior incompatible to perfork behavior which waitsinfinityle for stopping child processes? It causes really problems onmaintance and also doesn't permit use MaxRequestsPerChild option.
> > PS: Sorry if it is not right place for such questions.
> > --Ivan Zhakov
> >
> >
> >
>
> Hi Ivan,
> This is definitly the right place for this type of question. I think the few Win32 developers
> here (myself
> included) always had this on their list of 'todo's'. The Windows MPM needs to be
> enhanced to reliably support
> multiple child processes and when that's done, this will be fixed 'for free'.
Hi, Bill!
You meant Worker mpm? To be clear: you cannot simply change timeout to
infinite wait in mpm_wint?
It is really important, because Apache+Subversion is unusable in
production environment under Windows at present time :(

--
Ivan Zhakov

Re: mpm_winnt incompatible and broken behavior on restart

Posted by Bill Stoddard <bi...@wstoddard.com>.
Ivan Zhakov wrote:
> Hi!We have Apache/Subversion server under Windows Server 2003. And I wascome into problem with restarting server that process long request(more than 180 seconds). It's usual for bug Subversion repository. Isee messages like this in error.log:[Thu Oct 13 02:28:01 2005] [notice] Child 3952: Terminating 1 threadsthat failed to exit.
> I research problem and that mpm_winnt have hardcoded timeout forstopping working threads:http://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x/server/mpm/winnt/child.c:child_main()/* Give busy worker threads a chance to service their connections */    ap_log_error(APLOG_MARK,APLOG_NOTICE, APR_SUCCESS, ap_server_conf,                 "Child %d: Waiting for %d worker threads to exit.",my_pid, threads_created);    end_time = time(NULL) + 180;    while (threads_created) {        rv = wait_for_many_objects(threads_created, child_handles,end_time - time(NULL));        if (rv != WAIT_TIMEOUT) {            rv = rv - WAIT_OBJECT_0;            ap_assert((rv >= 0) && (rv < threads_created));            cleanup_thread(child_handles, &threads_created, rv);            continue;        }        break;    }
> After this timeout Apache terminate worker threads. Why is it? Whympm_winnt behavior incompatible to perfork behavior which waitsinfinityle for stopping child processes? It causes really problems onmaintance and also doesn't permit use MaxRequestsPerChild option.
> PS: Sorry if it is not right place for such questions.
> --Ivan Zhakov
> 
> 
> 

Hi Ivan,
This is definitly the right place for this type of question. I think the few Win32 developers here (myself 
included) always had this on their list of 'todo's'. The Windows MPM needs to be enhanced to reliably support 
multiple child processes and when that's done, this will be fixed 'for free'.

Bill