<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
pre
{mso-style-priority:99;
mso-style-link:"Préformaté HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:Consolas;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">My data are not located in a configuration file, all data can be updated in real-time without reloading. A single POST request triggers update
of the information by the worker that handles the request and all workers can then use updated information simultaneously.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">There may be possibilities to bypass the issue but so far, I’d like to understand why only this specific piece of data is lost, where everything
else is kept.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thierry<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Sergey Brester [mailto:serg.brester@sebres.de]
<br>
<b>Envoyé :</b> mercredi 22 juin 2016 11:48<br>
<b>À :</b> nginx-devel@nginx.org<br>
<b>Cc :</b> MAGNIEN, Thierry<br>
<b>Objet :</b> Re: [module dev] PCRE compiled code lost at reload<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">A little bit off-topic, but which benefits you think, you will get using cross process compiled regexp?<o:p></o:p></span></p>
<p style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">The compiling of regex is normally fast operation, that will be done only once (even jit), and can be done in each worker.<br>
What I cannot imagine, is the sharing of the result of regexp execution. But not the regexp self.<br>
Regards, sebres.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">22.06.2016 11:31, MAGNIEN, Thierry wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hi,<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>I'm experiencing a strange behavior and I wonder if I'm missing something obvious...<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>I've developed a module and I use shared memory and slab allocations to keep data unique across workers and have data survive a reload.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Everything works fine except one single thing: PCRE compiled codes (ngx_regex_compile_t->regex->code).<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>To be more precise, at reload, in my module init function, I recompile some of the PCRE if they have changed, still using shared memory. What I notice is that, just after init module function has returned, all dying workers lose PCRE compiled code (regex->code = 0), where all new created workers correctly get new compiled code.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>I tried to use my own pcre_malloc function in order to be sure memory is allocated in shared memory (and this *is* the case), but without success.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>So any help is welcome: does anyone have a clue about why only those data are "lost" by dying workers ?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Thanks a lot for your help,<o:p></o:p></pre>
<pre>Thierry Magnien<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>P.S.: I can't exhibit code for confidentiality reasons but if no one has a clue, I'll try to write a very simple module, only to exhibit this behavior.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>nginx-devel mailing list<o:p></o:p></pre>
<pre><a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><o:p></o:p></pre>
<pre><a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><o:p></o:p></pre>
</blockquote>
</div>
</body>
</html>