Menu

#370 Number of Listeners in MD statistics not counted correctly

2.1.0.0
closed
2261 (1)
2021-05-26
2021-05-25
No

The fields udpMd.numList and tcpMd.numList of the library statistics are not decremented correctly by tlm_delListener().

How to reproduce:

  1. Add a UDP listener with tlm_addListener() (any ComId is ok for reproducing the issue)
  2. Add a TCP listener (using the TRDP_FLAGS_TCP flag)
  3. Get the statistics; the counters will be UDP 1 and TCP 1
  4. Remove the TCP listener
  5. Get the statistics; the counters will be UDP 0 and TCP 1
  6. Remove the UDP listener
  7. Get the statistics; the counters will be UDP 4294967295 (underflow) and TCP 1

There are two issues in the code that decrements the counters:

  1. The global flags (appHandle->mdDefault.flags) are checked to select which counter has to be decremented; the flags registered on the listenHandle should be used instead.
  2. A counter is decremented even if the listenHandle is NULL or not found (dequeued == FALSE); this is not correct (IMHO).

Please consider the attached patch.

1 Attachments

Discussion

  • Lorenzo Buzzi

    Lorenzo Buzzi - 2021-05-25

    I forgot to mention that the issue affects 2.0.3.0 too.

     
  • Armin-Hagen Weiss

    • labels: --> 2261
    • status: open --> closed
    • assigned_to: Armin-Hagen Weiss
     
  • Armin-Hagen Weiss

    Code changed like proposed.

     

Log in to post a comment.

MongoDB Logo MongoDB