Welcome! Log In Create A New Profile

Advanced

Making parallel subrequests in a module

September 17, 2019 04:12PM
Hi,
I'm trying to make parallel network subrequests in my module. They work perfectly fine when run sequentially as follows.

```
ACCESS PHASE

return create_subrequest1; ---> (NGX_AGAIN)
return create_subrequest2; ---> (NGX_AGAIN)

```

To make it parallel, I removed the returns and called NGX_AGAIN twice later on in the access phase when the subrequests should be done. By doing this the subrequests are created in parallel and the right handler is called as well. However, when the second subrequest is finalized, I face an issue where r!=c->data for the second subrequest and so get this line in the logs

```
http finalize non-active request: "/<second_subrequest>/?"
```

So first subrequest is finalized, second subrequest handler is called but not finalized, parent request finshes and then second subrequest handler called again and finalized. I don't have the NGX_HTTP_SUBREQUEST_WAITED flag when calling the subrequest as well.

Anybody who has run into this kind of issue? Any thoughts on how to proceed?

Thanks!
- Salmaan
Subject Author Posted

Making parallel subrequests in a module

salmaanp September 17, 2019 04:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
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