<p dir="ltr">Hi Dragos,</p>
<p dir="ltr">Yes, that should work fine.</p>
<p dir="ltr">Cheers,</p>
<p dir="ltr">Charles</p>
<div class="gmail_quote">On 7 Jun 2013 12:00, "Dragos Oancea" <<a href="mailto:droancea@yahoo.com">droancea@yahoo.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div><span>Hi Charles,</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>Thank you for the information. These details are good to know.</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span>Do you think it's safe to use the new module from git with kamailio-4.0.0 ?</span></div><div>I mean just copying it in the kamailio-4.0.0 source tree, compiling it and then putting it in the modules directory to be loaded at runtime.</div>
<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">Regards,</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">
Dragos</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div>  <div style="font-size:10pt;font-family:arial,helvetica,sans-serif"> <div style="font-size:12pt;font-family:'times new roman','new york',times,serif">
 <div dir="ltr"> <hr size="1">  <font face="Arial"> <b><span style="font-weight:bold">From:</span></b> Charles Chance <<a href="mailto:charles.chance@sipcentric.com" target="_blank">charles.chance@sipcentric.com</a>><br>
 <b><span style="font-weight:bold">To:</span></b> Dragos Oancea <<a href="mailto:droancea@yahoo.com" target="_blank">droancea@yahoo.com</a>> <br><b><span style="font-weight:bold">Cc:</span></b> SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List <<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>> <br>
 <b><span style="font-weight:bold">Sent:</span></b> Friday, June 7, 2013 11:06 AM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [SR-Users] memcache problem - reporting protocol error<br> </font> </div> <div>
<br><div><div dir="ltr">The main difference, other than the new library, is the ability to specify an expiry for each stored key/value at the time of setting it:<div><br></div><div>So now there are two ways to set a value:</div>

<div><br></div><div>$mct(key) = value; (default expiry will be used as per module param)</div><div><br></div><div>or the new way, $mct(key=>expiry) = value;</div><div><br></div><div>
<br></div><div>Currently, the module still only supports a single memcache server, although if you are looking for a distributed solution, we have tested Couchbase/Moxi and it works really well.</div><div><br>
</div><div>All the best,</div><div><br></div><div>Charles</div><div><br></div><div><br><div>On 6 June 2013 20:40, Dragos Oancea <span dir="ltr"><<a rel="nofollow" href="mailto:droancea@yahoo.com" target="_blank">droancea@yahoo.com</a>></span> wrote:<br>

<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div><span>Hi Charles,</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">

<span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>Thank you for your answer.</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">

<span>I've notice that your name shows in the headers of the files of the new (patched) memcached module.</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">

Can you please detail a little bit on what does
 your patch bring new apart from libmemcached support ?</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">Or what does it still miss, since you said it's under heavy development.</div>

<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">

Many thanks!</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">

Regards,</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">Dragos</div><div><br></div>  <div style="font-size:10pt;font-family:arial,helvetica,sans-serif">

 <div style="font-size:12pt"> <div dir="ltr"> <hr size="1">  <font face="Arial"><div> <b><span style="font-weight:bold">From:</span></b> Charles Chance <<a rel="nofollow" href="mailto:charles.chance@sipcentric.com" target="_blank">charles.chance@sipcentric.com</a>><br>

 <b><span style="font-weight:bold">To:</span></b> Dragos Oancea <<a rel="nofollow" href="mailto:droancea@yahoo.com" target="_blank">droancea@yahoo.com</a>> <br></div><b><span style="font-weight:bold">Cc:</span></b> SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List <<a rel="nofollow" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>> <br>

 <b><span style="font-weight:bold">Sent:</span></b> Thursday, June 6, 2013 7:37 PM<div><div><br> <b><span style="font-weight:bold">Subject:</span></b> Re: [SR-Users] memcache problem - reporting protocol error<br>
 </div></div></font> </div><div><div> <div><br><div><div dir="ltr">Although it's difficult to know the exact cause of your "protocol" error, it does appear from your tests that the graceful handling of errors and subsequent reconnects is better in libmemcached than in libmemcache. So if you do encounter the same conditions again, I would imagine that the library would handle it and attempt to reconnect transparently.</div>



<div dir="ltr">If not, however, then at least you are more likely to find support as the library is still under active development :)</div>
<div dir="ltr">Cheers,</div>
<div dir="ltr">Charles<br>
</div>
<div>On 6 Jun 2013 18:12, "Dragos Oancea" <<a rel="nofollow" href="mailto:droancea@yahoo.com" target="_blank">droancea@yahoo.com</a>> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div><span>Hi Charles,</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>I tried first to trigger again the bug using some iptables rules (to simulate a network problem) , so Kamailio could not communicate with the memcache anymore:</span></div>


<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span><div style="background-color:transparent"> WARNING: memcached [memcached.c:189]: WARNING: memcached: mcm_server_readable():2582: timeout: select(2) call timed out for read(2)able fds</div><div style="background-color:transparent">


WARNING: memcached [memcached.c:189]: WARNING: memcached: mcm_server_writable():3173: timeout: write select(2) call timed out<br></div><div style="background-color:transparent">WARNING: memcached [memcached.c:189]: WARNING: memcached: mcm_server_connect():2290: select(2) failed: select(2) timed out on establishing conn</div>


<div style="background-color:transparent">ection</div><div style="background-color:transparent">NOTICE: memcached [memcached.c:194]: NOTICE: memcached: mcm_server_connect():2297: connect(2) failed</div><div style="background-color:transparent">


NOTICE: memcached [memcached.c:194]: NOTICE: memcached: mcm_server_connect_next_avail():2323: unable to find a server to connect
 to</div></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span>This looks very much like what i've seen in the logs just before it started to report the "protocol error" problem.</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>But in the simulated case , after I remove the iptables rules that block the access to memcache, Kamailo does not recover from the situation, it just keeps on printing messages
 like the above, when it should</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>connect to memcache instead. It looks like another libmemcache-related bug to me.</span></div>


<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span>Then I tried the same thing with  the latest memcached module from git:</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>With the memcached firewalled after starting Kamailio it prints this to the logs:</span></div>


<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><div style="background-color:transparent"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


ERROR: memcached [mcd_var.c:154]: pv_get_mcd_value_helper(): could not get result for </div><div style="background-color:transparent">key 29515_HA1 - error was 'SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY'</div>


</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


When I flush the firewall rules, it reconnects to memcache, which makes it better than the
 old one.</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>But how can I be sure that the new one will not have the same "protocol error" issue, since I could not reproduce exactly the problem so far ? </span></div>


<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>Regards,</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span>Dragos</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">


<span><br></span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div>  <div style="font-size:10pt;font-family:arial,helvetica,sans-serif"> <div style="font-size:12pt">


 <div dir="ltr"> <hr size="1">  <font face="Arial"> <b><span style="font-weight:bold">From:</span></b> Charles Chance <<a rel="nofollow" href="mailto:charles.chance@sipcentric.com" target="_blank">charles.chance@sipcentric.com</a>><br>


 <b><span style="font-weight:bold">To:</span></b> Dragos Oancea
 <<a rel="nofollow" href="mailto:droancea@yahoo.com" target="_blank">droancea@yahoo.com</a>>; Kamailio (SER) - Users Mailing List <<a rel="nofollow" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>> <br>


 <b><span style="font-weight:bold">Sent:</span></b> Thursday, June 6, 2013 6:27 PM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [SR-Users] memcache problem - reporting protocol error<br> </font> </div> <div>


<br><div><div><div dir="ltr">Hi Dragos,<div><br></div><div>The memcached module has indeed been updated in the master to use libmemcached, as the old libmemcache library is no longer under active development. Have you tried using the latest version of the module from git? Do you still get the same errors?</div>




<div><br></div><div>Cheers,</div><div><br></div><div>Charles</div><div><br><br><div>On 6 June 2013 16:18, Dragos Oancea <span dir="ltr"><<a rel="nofollow" href="mailto:droancea@yahoo.com" target="_blank">droancea@yahoo.com</a>></span> wrote:<br>




<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div>Hello<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">




<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">




We are having issues with the memcached module (Kamailio 4.0.0) . </div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">




<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">All of a sudden we are getting this kind of messages in the logs, and the values for the requested keys are not retrieved.</div>




<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">




<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">ALERT: memcached [memcached.c:189]: ALERT: memcached: mcm_fetch_cmd():1305: memcache(4) protocol error: STORED#015#012VALUE 29515_HA1 0
 32#015#012b52299247f16c6adfa4c8cc53b34e74a#015#012END#015#012STORED#015#012<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><div style="background-color:transparent">




[...]</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">ALERT: memcached [memcached.c:189]: ALERT: memcached: mcm_fetch_cmd():1176: memcache(4) protocol error: server sent data for key not in request</div>




<div><br></div><div><br></div><div>I suspect that at some point there was a network problem between the memcached server and Kamailio that triggered this abnormal behavior and I also suspect that it is </div><div>connected with the (old) libmemcache library (libmemcache-1.4.0.rc2) .</div>




<div><br></div><div><br></div><div>This is fixed only with a Kamailio restart. <br></div><div><br></div><div><br></div><div>Has anyone experience this ?  Is there a fix ?</div><div>I noticed that the Kamailio from the trunk compiles the memcached module with the more new libmemcached library from here: <a rel="nofollow" href="https://launchpad.net/libmemcached/+download" style="color:blue;text-decoration:underline!important" target="_blank">https://launchpad.net/libmemcached/+download</a> .<br>




</div><div>Maybe this is one of the reasons libmemcache is going to be dropped ?</div><div><br></div><div>Thank you very much.</div><div><br></div><div>Regards,</div><div>Dragos </div><div><br></div></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">




<br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div></div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a rel="nofollow" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a rel="nofollow" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br>
</div></div>

<br>
</div><font face="Helvetica, Arial, sans-serif"><font><span style="font-size:10pt"><a rel="nofollow" href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>



            <br>
            Follow us on twitter <a rel="nofollow" href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">@sipcentric</a><br>
            <br>
            <font color="gray">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered
                office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.</font></span></font></font></div><br><br></div> </div> </div>  </div></div></blockquote></div>

<br>
<font face="Helvetica, Arial, sans-serif"><font><span style="font-size:10pt"><a rel="nofollow" href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
            <br>
            Follow us on twitter <a rel="nofollow" href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">@sipcentric</a><br>
            <br>
            <font color="gray">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered
                office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.</font></span></font></font></div><br><br></div> </div></div></div> </div>  </div></div></blockquote></div><br><br clear="all">

<div><br></div>
</div></div>

<br>
<font face="Helvetica, Arial, sans-serif"><font><span style="font-size:10pt"><a rel="nofollow" href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
            <br>
            Follow us on twitter <a rel="nofollow" href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">@sipcentric</a><br>
            <br>
            <font color="gray">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered
                office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.</font></span></font></font></div><br><br></div> </div> </div>  </div></div></blockquote></div>

<br>
<font face="Helvetica, Arial, sans-serif"><font size="2"><span style="font-size:10pt"><a href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
            <br>
            Follow us on twitter <a href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">@sipcentric</a><br>
            <br>
            <font color="gray">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered
                office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.</font></span></font></font>