Welcome! Log In Create A New Profile

Advanced

RE:[module dev] PCRE compiled code lost at reload

MAGNIEN, Thierry
June 22, 2016 10:50AM
Hi,


I think I start understanding what's wrong.

Let me explain what I've done:

I have a ngx_http_mymodule_data_t struct which include this:
ngx_pool_t *regex_pool;

After initializing my data struct in shared memory, I do something like this:
my_data->regex_pool = ngx_create_pool(REGEX_POOL_SIZE, cycle->log);

Later, at regex compilation, I use this:
my_regex.pool = ((ngx_http_mymodule_data_t *)(sr_shm_zone->data))->regex_pool;

And if I understand correctly, the pool created by ngx_create_pool gets freed. Am I right ?

If so, is there a possibility to use a pool that would survive reload ?

Thanks,
Thierry

________________________________________
De : nginx-devel [nginx-devel-bounces@nginx.org] de la part de Maxim Dounin [mdounin@mdounin.ru]
Envoyé : mercredi 22 juin 2016 16:27
À : nginx-devel@nginx.org
Objet : Re: [module dev] PCRE compiled code lost at reload

Hello!

On Wed, Jun 22, 2016 at 02:21:51PM +0000, MAGNIEN, Thierry wrote:

> Thanks for your response. I already saw that, and that's why I
> use a dedicated pool in shared memory for regex compilation. All
> my ngx_regex_compile_t structs allocate from this unique pool.
> Could pool in shared memory be automatically freed when
> reloading ? And in that case, why would new workers get the
> correct value ? Is there a place where memory is duplicated
> between workers before dying/start of workers ?

There are no pools in shared memory in nginx - except
ngx_slab_pool_t, which is quite different from normal memory
pools and cannot be used in ngx_regex_compile_t.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[module dev] PCRE compiled code lost at reload

MAGNIEN, Thierry 423 June 22, 2016 05:34AM

Re: [module dev] PCRE compiled code lost at reload

Sergey Brester 252 June 22, 2016 05:48AM

RE: [module dev] PCRE compiled code lost at reload

MAGNIEN, Thierry 276 June 22, 2016 06:00AM

Re: [module dev] PCRE compiled code lost at reload

Maxim Dounin 238 June 22, 2016 09:50AM

RE:[module dev] PCRE compiled code lost at reload

MAGNIEN, Thierry 255 June 22, 2016 10:24AM

Re: [module dev] PCRE compiled code lost at reload

Maxim Dounin 270 June 22, 2016 10:28AM

RE:[module dev] PCRE compiled code lost at reload

MAGNIEN, Thierry 272 June 22, 2016 10:50AM

Re: [module dev] PCRE compiled code lost at reload

Maxim Dounin 259 June 22, 2016 11:00AM

RE:[module dev] PCRE compiled code lost at reload

MAGNIEN, Thierry 265 June 22, 2016 11:04AM



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

Online Users

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