Menu

#494 dialog: statistics active_dialogs inaccurate on restart

ver 1.3.x
open
modules (357)
5
2008-07-29
2008-07-28
No

If OpenSER is restarted while calls are active, the statistics module stops accurately reporting the active_dialogs statistic. What appears happens is the counter resets to 0 on restart, but if there are active calls, the counter will start from 0. If a call hangs up, the counter appears to wrap around backwards to 4294967296.

There were 38 calls when I restarted OpenSER and this is what my counters get:

[root@sip-01-c61-56-atl ~]# openserctl fifo get_statistics active_dialogs
dialog:active_dialogs = 4294967293
[root@sip-01-c61-56-atl ~]# openserctl fifo dlg_list | grep dialog:: | wc -l
34

As you can see, 4 calls hung up during the restart. the dialog module knows that there are 34 calls, but statistics has wrapped backwards to 4294967293.

Discussion

  • Henning Westerholt

    • summary: statistics module active_dialogs inaccurate on restart --> dialog: statistics active_dialogs inaccurate on restart
     
  • Henning Westerholt

    dialog-wrap-fix.patch

     
  • Henning Westerholt

    Logged In: YES
    user_id=337916
    Originator: NO

    Hi,

    i've attached a small patch, which adds a new statistics #define that checks against this conditions and change the dialog code to use this for relevant cases. The patch is for the trunk, but also apply on the 1.3 branch.

    Would be nice if you could test, and somebody with a little bit more knowledge about the dialog module could review if this is the best way of fixing the problem.

    Henning
    File Added: dialog-wrap-fix.patch

     
  • Henning Westerholt

    • assigned_to: nobody --> henningw
     
  • Aubrey Wells

    Aubrey Wells - 2008-07-30

    Logged In: YES
    user_id=847429
    Originator: YES

    I'll try your patch in my maint window tomorrow. Thanks.

     
  • Aubrey Wells

    Aubrey Wells - 2008-07-31

    Logged In: YES
    user_id=847429
    Originator: YES

    Doesnt seem to have worked:

    Before making a call:
    [root@rolecall ~]# openserctl fifo get_statistics active_dialogs
    dialog:active_dialogs = 0

    Call up:
    [root@rolecall ~]# openserctl fifo get_statistics active_dialogs
    dialog:active_dialogs = 1

    Restart openser with call active:
    [root@rolecall ~]# service openser restart
    Stopping openser: [ OK ]
    Starting openser: [ OK ]
    [root@rolecall ~]#

    After restart, call still up:
    [root@rolecall ~]# openserctl fifo get_statistics active_dialogs
    dialog:active_dialogs = 0

    Hung up call - counter has wrapped:
    [root@rolecall ~]# openserctl fifo get_statistics active_dialogs
    dialog:active_dialogs = 4294967295

     
  • Henning Westerholt

    Logged In: YES
    user_id=337916
    Originator: NO

    Hi,

    ok, aparently the previous patch was not sufficient, sorry about that. Anyway i've ported a different fix to the trunk, see http://openser.svn.sourceforge.net/openser/?rev=4551&view=rev

    Now the statistic counter should be properly initialized from the database content during startup. The patch also applies to the 1.3 branch.

    Henning

     
  • Aubrey Wells

    Aubrey Wells - 2008-08-05

    Logged In: YES
    user_id=847429
    Originator: YES

    Will the patch apply cleanly with, or does it require the previous patch, or do I need to back out the first patch before applying this one?

     
  • Henning Westerholt

    Logged In: YES
    user_id=337916
    Originator: NO

    The previous patch is not needed anymore. If the new one apply correctly it will probably also work, if you don't like to backout the previous one. There more or less unrelated. I'll port tomorow some more bug fixes, so perhaps you want to wait for them too.

     
  • Aubrey Wells

    Aubrey Wells - 2008-08-06

    Logged In: YES
    user_id=847429
    Originator: YES

    Well, that didn't work. OpenSER now dumps core when the dialog module loads if there is anything in the dialog table. If I hang up and delete the entries in the dialog table, it will start fine.

    Aug 5 21:36:50 [5829] INFO:snmpstats:mod_init: Starting up the SNMPStats Module
    Aug 5 21:36:50 [5829] INFO:dialog:mod_init: Dialog module - initializing
    Segmentation fault (core dumped)

     
  • Aubrey Wells

    Aubrey Wells - 2008-08-06

    Logged In: YES
    user_id=847429
    Originator: YES

    I'm trying to upload a core file, but sourceforge is not letting me. If you think a core file will be helpful, email me and I can send you ftp credentials to get it.

     
  • Henning Westerholt

    Logged In: YES
    user_id=337916
    Originator: NO

    Hi,

    does it works also if you restart the server, or do you observe then a core dump again? E.g. do you get a core dump everytime? Perhaps you can attach the backtrace from the core dump, or send it to me via mail, if it contains sensitive informations, henning dot westerholt at 1und1 dot de

    Henning

     
  • Aubrey Wells

    Aubrey Wells - 2008-08-10

    Logged In: YES
    user_id=847429
    Originator: YES

    It coredumps on startup if there are entries in the dialog db table. It will coredump every time. If i hang up running calls (or delete the entries from the dialog table by hand) the server will start up normally. I am emailing the core file now. I had to gzip it to get it to send.

     
  • Ovidiu Sas

    Ovidiu Sas - 2008-08-11

    Logged In: YES
    user_id=1395524
    Originator: NO

    Hello Aubrey,

    Please test the latest kamailio trunk version and see if the issue is still present (no need to apply any patch).

    Regards,
    Ovidiu Sas

     

Log in to post a comment.

MongoDB Logo MongoDB