httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pöchtrager, Bernhard <bernhard.poechtra...@fabasoft.com>
Subject Re: Module: Mod_Dialup (ap_mpm_register_timed_callback)
Date Thu, 24 May 2012 09:26:31 GMT


> -----Ursprüngliche Nachricht-----
> Von: Joe Lewis [mailto:jlewis@silverhawk.net] Im Auftrag von jlewis
> Gesendet: Mittwoch, 23. Mai 2012 17:38
> An: modules-dev@httpd.apache.org
> Cc: Pöchtrager, Bernhard
> Betreff: Re: Module: Mod_Dialup (ap_mpm_register_timed_callback)
> 
> On Wed, 23 May 2012 06:43:33 +0000
> "Pöchtrager, Bernhard" <bernhard.poechtrager@fabasoft.com> wrote:
> 
> > > -----Ursprüngliche Nachricht-----
> > > Von: Joe Lewis [mailto:jlewis@silverhawk.net] Im Auftrag von Joe
> > > Lewis Gesendet: Dienstag, 22. Mai 2012 17:40
> > > An: modules-dev@httpd.apache.org
> > > Betreff: Re: Module: Mod_Dialup (ap_mpm_register_timed_callback)
> > >
> > >
> > >
> > > On 05/22/2012 12:27 AM, Pöchtrager, Bernhard wrote:
> > > > Hello
> > > >
> > > > I am trying to work with asynchronous requests.
> > > > With synchronous requests everything WORKS fine.
> > > > I write it like mod_dialup.c.
> > > > The result is that every second request is unsuccessful (The
> > > > Browser is
> > > loading the whole time).
> > > Bernhard;
> > >
> > > Do you mean that the connection just appears to be loading?  Does it
> > > timeout?  Or does the page successfully load?
> > >
> > > Do you see error messages?  Are you logging anything to help debug
> > > this? Can you share things like - what you are trying to accomplish,
> > > code, etc?
> > >
> > > Joe
> > >
> >
> > Thanks for your reply.
> > The "complete" explanation was in the first e-mail (apended at the
> > end). I write it again with more information.
> >
> > I am trying to work with asynchronous requests.
> > With synchronous requests everything WORKS fine.
> > I write it like mod_dialup.c.
> > The result is that every second request is unsuccessful (The Browser
> > is loading the whole time). I put some logging-code into the programm.
> > The result ist that the first request works well. When I make a second
> > request the handler doesn't start at all. I get no error and no
> > logging-output. I even log the event.c file, but I get nothing. The
> > request is loading the whole time (I think until he reachs the
> > time-out). After I cancel the request I can make another successful
> > request. When I make another request I have the same problem. I mean
> > every second request is unsuccessful. I even looked with Wireshark on
> > the packages. When the problem appears he got only a few packages. I
> > think the problem is in the line " rv =
> > ap_queue_pop_something(worker_queue, &csd, &cs, &ptrans, &te);"
in
> the
> > methode "static void *APR_THREAD_FUNC worker_thread(apr_thread_t
> > * thd, void *dummy)" in the event.c file. I think that the first
> > request isn't finished completely.
> >
> > The relevant Code of the handler is (the change from sync to async):
> >
> ap_mpm_register_timed_callback(apr_time_from_msec(1000),callback,prr);
> > return SUSPENDED;
> >
> > The callback method:
> > static void callback(void* data)
> > {
> >     request_rec* prr = (request_rec*) data;
> >     ap_finalize_request_protocol(prr);
> >     ap_process_request_after_handler(prr);
> > }
> > Do you have any ideas?
> >
> 
> Since you are developing your own MPM, I'd suggest getting an strace
> (Linux) or something akin to truss (BSD).  You need to find out exactly what
> your MPM is doing when the first request "finishes", and then when the
> second one starts up.  strace will give you a LOT of information, and the more
> information you have, the better.
> 
> Joe

I created two files. One file with a strace of a successful request and one with a strace
of an unsuccessful request.
The first significant differences between these two requests are following lines.

4171  <... futex resumed> )             = -1 EAGAIN (Resource temporarily unavailable)
4170  <... futex resumed> )             = -1 EAGAIN (Resource temporarily unavailable)
4169  <... futex resumed> )             = -1 EAGAIN (Resource temporarily unavailable)
4168  <... futex resumed> )             = -1 EAGAIN (Resource temporarily unavailable)
4167  <... futex resumed> )             = -1 EAGAIN (Resource temporarily unavailable)
4166  <... futex resumed> )             = -1 EAGAIN (Resource temporarily unavailable)
4164  <... futex resumed> )             = -1 EAGAIN (Resource temporarily unavailable)
4171  futex(0x1eda654, FUTEX_WAIT_PRIVATE, 42, NULL <unfinished ...>
4170  futex(0x1eda654, FUTEX_WAIT_PRIVATE, 42, NULL <unfinished ...>
4169  futex(0x1eda654, FUTEX_WAIT_PRIVATE, 42, NULL <unfinished ...>
4168  futex(0x1eda654, FUTEX_WAIT_PRIVATE, 42, NULL <unfinished ...>
4167  futex(0x1eda654, FUTEX_WAIT_PRIVATE, 42, NULL <unfinished ...>
4166  futex(0x1eda654, FUTEX_WAIT_PRIVATE, 42, NULL <unfinished ...>
4164  futex(0x1eda654, FUTEX_WAIT_PRIVATE, 42, NULL <unfinished ...>

Well I think that the first request didn't finish correctly. But what can I do?
Do you have any ideas?

Bernhard
Mime
View raw message