<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Julien,<br>
    <br>
    I've successfully replicated the issue, and it seems the issue is
    that there's a memcached 'bug', so that when you try to fetch the
    counter as a string,it returns the length as being the biggest
    number of digits that the counter has ever had.<br>
    <br>
    In OpenSIPS 1.9 and trunk, the fix was fairly straight-forwards,
    since in the CacheDB interface there is a separate function that
    should be using when fetching a counter, so the mitigation for this
    memcached issue was done in the cachedb_memcached module.<br>
    <br>
    In OpenSIPS 1.8, we had a single function responsible for fetching
    keys &amp; counters, and thus I fixed this issue my right&amp;left
    trimming spaces in the dialog module when fetching what we expect to
    be a counter.<br>
    <br>
    Regards,<br>
    <pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a> </pre>
    <br>
    On 02/05/2013 02:08 PM, Vlad Paiu wrote:
    <blockquote cite="mid:5110F633.3050905@opensips.org" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      Hello Julien,<br>
      <br>
      This bug seems to have fallen through the cracks while we were
      preparing for the release, so sorry for this. <br>
      Next time, for bug reporting, could you please use the SF tracker
      ?<br>
      <br>
      About the actual bug, not sure if I entirely get your last
      message's point, and how would incrementing by 0 help solve the
      issue ?<br>
      As far as I understand, the issue appears when you get more than
      10 dialogs ongoing and you try to get the profile size ?<br>
      <br>
      I will try to replicate this locally, but I'd appreciate a little
      bit more details about the issue.<br>
      <br>
      Best Regards,<br>
      <pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a> </pre>
      <br>
      On 01/14/2013 01:46 PM, Julien Chavanton wrote:
      <blockquote
cite="mid:CAKmcL2nNre_a0vEmUrcO3mcg2-4E0wmfmtAXN=ZG+c+wYFD7VA@mail.gmail.com"
        type="cite">One option would be to increment by 0 using a
        memcached_increment and use the return value, this way we keep
        the atomic feature provided by memcached.<br>
        <br>
        However this would break the cachedb abstraction since we would
        not use a normal "cdb_func.get" but a cdb_func.add "0"<br>
        <br>
        dialog profile -get-&gt; | cachedb |&nbsp; memcached<br>
        <br>
        Cachedb specific feature like increment may not be easily
        abstracted.<br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <div class="gmail_quote">On Mon, Jan 14, 2013 at 11:52 AM,
          Julien Chavanton <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:jchavanton@gmail.com"
              target="_blank">jchavanton@gmail.com</a>&gt;</span> wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">I found out that the problem is taking
            place in memcached, once the size of a value is not lowered
            when decrementing. <br>
            <br>
            This is what we have int memcached after having reached a
            dialog profile of a number with more then 2 digits (10+)<br>
            <br>
            # Increment<br>
            incr dlg_val_caller_ODA1MQ== 1.<br>
            1.<br>
            <br>
            # Get the value (size 2 !!)<br>
            get dlg_val_caller_ODA1MQ== .<br>
            VALUE dlg_val_caller_ODA1MQ== 0 2.<br>
            1 .<br>
            END.<br>
            <br>
            # Decrement<br>
            decr dlg_size_caller 1.<br>
            0.<br>
            <br>
            ----------------------------------------------------------<br>
            <br>
            Then str2int is failing in dlg_profile.c <br>
            <br>
            &nbsp;if (str2int(&amp;ret, &amp;n) &lt; 0) {<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LM_ERR("invalid int value in CacheDB
            &lt;%.*s&gt;\n",
            <div class="HOEnZb">
              <div class="h5"><br>
                <br>
                <br>
                <br>
                <br>
                <div class="gmail_quote">On Mon, Jan 14, 2013 at 10:34
                  AM, Julien Chavanton <span dir="ltr">&lt;<a
                      moz-do-not-send="true"
                      href="mailto:jchavanton@gmail.com" target="_blank">jchavanton@gmail.com</a>&gt;</span>
                  wrote:<br>
                  <blockquote class="gmail_quote" style="margin: 0pt 0pt
                    0pt 0.8ex; border-left: 1px solid rgb(204, 204,
                    204); padding-left: 1ex;"> Hi, I found a problem
                    that may require more investigation but just in case
                    I do not look into it further I wanted to raise the
                    issue.<br>
                    <br>
                    Problem found while testing dialog profiles :<br>
                    &nbsp;<br>
                    ERROR:dialog:get_profile_size: invalid int value in
                    CacheDB &lt;1 &gt; <br>
                    ERROR:dialog:get_profile_size: invalid int value in
                    CacheDB &lt;0 &gt; <br>
                    <br>
                    This problem with the white space as triggered while
                    testing when the profile get higher then 10 ?<br>
                    <br>
                    <br>
                  </blockquote>
                </div>
                <br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
      </blockquote>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
    </blockquote>
  </body>
</html>