<h3>Description</h3>
<p>Since we upgraded from v5.0.2 to v5.1.4 we are seeing spikes in our monitoring platform regarding current active and early dialogs.</p>
<p>Every 10s we gather metrics using Kamailio's HTTP server:</p>
<pre><code>    # Statistics endpoint
    if ($hu =~ "^/statistics") {
        jsonrpc_exec('{"jsonrpc": "2.0","method": "stats.get_statistics","params": ["all"],"id": 1}');
        xhttp_reply("200", "OK", "application/json", "$jsonrpl(body)");
        exit;
    }
</code></pre>
<p>stats.get_statistics has lots of metrics, the problematic ones we have found are:</p>
<pre><code>    "dialog.active_dialogs":  "84",
    "dialog.early_dialogs": "16",
</code></pre>
<p>The issue is that randomly, instead of reporting the real active/early dialogs, it will return <strong>9223372036854776000</strong>.</p>
<p>Example:</p>
<pre><code>...
    "dialog.active_dialogs":  "77",
    "dialog.early_dialogs": "9223372036854776000",
...

...
    "dialog.active_dialogs":  "9223372036854776000",
    "dialog.early_dialogs": "20",
...

...
    "dialog.active_dialogs":  "83",
    "dialog.early_dialogs": "18",
...

</code></pre>
<h3>Troubleshooting</h3>
<p>I added logging for kamailio to print the value for active-dialogs just to make sure it wasn't a problem further down in the pipeline, and I could see that same number, so it's definitely coming from Kamailio. Also, on version v5.0.2 installed from deb repo this did not happen.</p>
<h4>Reproduction</h4>
<p>I cannot reproduce on purpose, I see it happen several times a day though.</p>
<h4>Debugging</h4>
<p>Please let me know what I can provide to troubleshoot this, I don't know where to start, I'm concerned of activating debug logs in prod and waiting for this to happen might overload the system, any alternatives?</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code># kamailio -v
version: kamailio 5.1.4 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 6.3.0
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>OS: Debian stretch 9.4

Kernel: Linux kamailio 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1591">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZVvLs2zGD8g7tWk2Gc5clEl6xBfzks5uFj8TgaJpZM4VLmd9">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36Zc6bQ6B5PGR-xLrM5zjw_fZ6YuMnks5uFj8TgaJpZM4VLmd9.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"KEx module stats.get_statistics() randomly reporting 9223372036854776000 for current active/early dialogs (#1591)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1591"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1591",
"url": "https://github.com/kamailio/kamailio/issues/1591",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "KEx module stats.get_statistics() randomly reporting 9223372036854776000 for current active/early dialogs (#1591)",
"sections": [
{
"text": "",
"activityTitle": "**Joel Serrano**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@joelsdc",
"facts": [
{
"name": "Repository: ",
"value": "kamailio/kamailio"
},
{
"name": "Issue #: ",
"value": 1591
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1591,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1591\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1591"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 355362685\n}"
}
],
"themeColor": "26292E"
}
]</script>