Peter Leonov
May 16, 2010 05:26PM
Hello Piotr,
Thanks for a fast reply!

On 17.05.2010, at 0:08, "Piotr Sikora" <> wrote:

> Hi,
>> If a subrequest is issued from timer nginx doesn't know about it
>> until the request is somehow accessed from the network. Otherwise
>> the subrequest stays stuck forever.
> Do I understand correctly, that you're starting subrequest without
> parent request?
My bad, tried to be short :)

There is a request, main request in terms of nginx. It is passed to a
module and the module desides to set a timer. A separated timer in the
module context structure, neither on the request read nor the write
event struct. The module handler returns (after r->main->count++ of
course) and we are left waiting for the timer.

Time passes and finally the request timer fires. In the timer handler
the subrequest is issued. And here comes tge troubles :)

The subrequest stays frozen if it just a struct in memory and nginx
doesn't know about it. But, on the main request connection timeout the
request comes to life and nginx process it correctly (as far as I can

>> How may a module signal nginx about a new subrequest to process?
> Do you mean signal nginx that:
> a) it's time to start subrequest?
> or
> b) response from subrequest arrived?
The a) variant is most close.
The module mentioned above can issue a subrequest and get its content
already. But only from the handler in the content phase, not from the
naked timer handler.

Best regards,

nginx-devel mailing list
Subject Author Views Posted

Issue a subrequest from a timer handler

Peter Leonov 2789 May 16, 2010 02:52PM

Re: Issue a subrequest from a timer handler

Piotr Sikora 1114 May 16, 2010 04:10PM

Re: Issue a subrequest from a timer handler

Peter Leonov 1061 May 16, 2010 05:26PM

Re: Issue a subrequest from a timer handler

Maxim Dounin 1079 May 16, 2010 05:20PM

Re: Issue a subrequest from a timer handler

Peter Leonov 1724 May 17, 2010 02:42AM

Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 332
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready