[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-users
Subject:    Re: [squid-users] cannot leave empty workers
From:       Alex Wu <alex_wu2012 () hotmail ! com>
Date:       2015-07-25 15:55:49
Message-ID: BAY181-W63F1DD705D3F0C90962B2E83800 () phx ! gbl
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I may concur with the way it is.

For shared memory, if it is created by worker, it might trigger a race condition. \
Also, the size of shared segment is fixed across all processes, so each worker cannot \
create a different size of shared memory. So the current code simply lets master \
process create it, and wokrer just attaches to it.

Alex


> Subject: Re: [squid-users] cannot leave empty workers
> To: alex_wu2012@hotmail.com; squid-users@lists.squid-cache.org
> From: squid3@treenet.co.nz
> Date: Sat, 25 Jul 2015 12:54:47 +1200
> 
> On 25/07/2015 11:53 a.m., Alex Wu wrote:
> > further analysis indicated that master process created \
> > quid-ssl_session_cache.shm. 
> > In other words, it needs a https_port or http_port with ssl-bump in outside any \
> > process number to create this shared memeory segment. 
> > Furthermore, the code  should be simplied like this:
> > 
> > diff --git a/squid-3.5.6/src/ssl/support.cc b/squid-3.5.6/src/ssl/support.cc
> > index 85305ce..0ce95f9 100644
> > --- a/squid-3.5.6/src/ssl/support.cc
> > +++ b/squid-3.5.6/src/ssl/support.cc
> > @@ -2084,9 +2084,6 @@ SharedSessionCacheRr::useConfig()
> > void
> > SharedSessionCacheRr::create()
> > {
> > -    if (!isSslServer()) //no need to configure ssl session cache.
> > -        return;
> > -
> > int items;
> > items = Config.SSL.sessionCacheSize / sizeof(Ipc::MemMap::Slot);
> > if (items)
> > 
> > 
> > 
> > This code is called in master that may not have configuration to ensure \
> > isSsslServer return true. 
> 
> The bug is in why that SharedSessionCacheRr is not being run by the worker.
> 
> AFAIK, it is the way the worker is supposed to attach to the shared
> memory. First process to access the SHM does the create, others attach.
> 
> Amos
> 
 		 	   		  


[Attachment #5 (text/html)]

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>I may concur with the way it is.<br><br>For \
shared memory, if it is created by worker, it might trigger a race condition. Also, \
the size of shared segment is fixed across all processes, so each worker cannot \
create a different size of shared memory. So the current code simply lets master \
process create it, and wokrer just attaches to it.<br><br>Alex<br><br><br><br /><br \
/><div>> Subject&#58; Re&#58; &#91;squid-users&#93; cannot leave empty workers<br>> \
To&#58; alex_wu2012&#64;hotmail.com&#59; squid-users&#64;lists.squid-cache.org<br>> \
From&#58; squid3&#64;treenet.co.nz<br>> Date&#58; Sat, 25 Jul 2015 12&#58;54&#58;47 \
&#43;1200<br>> <br>> On 25/07/2015 11&#58;53 a.m., Alex Wu wrote&#58;<br>> &#62; \
further analysis indicated that master process created \
quid-ssl_session_cache.shm.<br>> &#62; <br>> &#62; In other words, it needs a \
https_port or http_port with ssl-bump in outside any process number to create this \
shared memeory segment.<br>> &#62; <br>> &#62; Furthermore, the code  should be \
simplied like this&#58;<br>> &#62; <br>> &#62; diff --git \
a/squid-3.5.6/src/ssl/support.cc b/squid-3.5.6/src/ssl/support.cc<br>> &#62; index \
85305ce..0ce95f9 100644<br>> &#62; --- a/squid-3.5.6/src/ssl/support.cc<br>> &#62; \
&#43;&#43;&#43; b/squid-3.5.6/src/ssl/support.cc<br>> &#62; &#64;&#64; -2084,9 \
&#43;2084,6 &#64;&#64; SharedSessionCacheRr&#58;&#58;useConfig&#40;&#41;<br>> &#62;  \
void<br>> &#62;  SharedSessionCacheRr&#58;&#58;create&#40;&#41;<br>> &#62;  \
&#123;<br>> &#62; -    if &#40;&#33;isSslServer&#40;&#41;&#41; //no need to configure \
ssl session cache.<br>> &#62; -        return&#59;<br>> &#62; -<br>> &#62;      int \
items&#59;<br>> &#62;      items &#61; Config.SSL.sessionCacheSize / \
sizeof&#40;Ipc&#58;&#58;MemMap&#58;&#58;Slot&#41;&#59;<br>> &#62;      if \
&#40;items&#41;<br>> &#62; <br>> &#62; <br>> &#62; <br>> &#62; This code is called in \
master that may not have configuration to ensure isSsslServer return true.<br>> &#62; \
<br>> <br>> The bug is in why that SharedSessionCacheRr is not being run by the \
worker.<br>> <br>> AFAIK, it is the way the worker is supposed to attach to the \
shared<br>> memory. First process to access the SHM does the create, others \
attach.<br>> <br>> Amos<br>> <br></div> 		 	   		  </div></body> </html>


[Attachment #6 (text/plain)]

_______________________________________________
squid-users mailing list
squid-users@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic