<p>This exists on latest master <a href="https://github.com/OpenSIPS/opensips/commit/055f4b132a06f4fdc2c19d6cbae9f0c94114cc24" class="commit-link"><tt>055f4b1</tt></a> </p>

<p>Scenario:  2 PUBLISHES with the same E-Tag enter <a href="https://github.com/OpenSIPS/opensips/blob/master/modules/presence/presentity.c#L546">https://github.com/OpenSIPS/opensips/blob/master/modules/presence/presentity.c#L546</a> as a result of a retransmission.</p>

<p>The first publish finds the presentity, increments last turn to say 5 for the sake of argument, then it enters the while loop, finds the presentity and continues processing updating it with a new e-tag and saving it the db releases locks and finishes.</p>

<p>The second publish enters because its turn matches 5, it finds the presentity and increments last turn to 6, it then enters the while loop, but it fails to find the presentity because the E-Tag has been changed by the previous publish.  It continues processing, but it never increments turn before exiting.  </p>

<p>This causes turn to stay at 6, which will cause the process to lockup forever, waiting for its turn, on the next publish received.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/754">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciUXFc8iObHh9wN5XIdVwcegea8Lsks5pZo4ZgaJpZM4HEPZn.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/754"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>