Pre-Submission Checklist

Type Of Change

Checklist:

Description

2 issues:

Issue 1:
Currently statsd functions return bool: true or false depending when
the function succeeds or fails respectively.

This value gets implicitly converted to int: true -> 1, false ->
0.

For Kamailio 1 means succesfull execution, but 0 means to stop
processing messages, which is not what we want as statsd should not impact
flow execution. Instead we want to return -1 which signifies error,
but the flow continues.

Issue 2:
statsd_init executes statsd_connect which tries to connect to statd
server.

If connection fails then kamailio fails to start.
This is not the desired behaviour as:

  1. Kamailio should continue working even if statsd server is down,
    metrics should not impact runtime.
  2. statsd_connect is also re-executed each time we try to send the metric https://github.com/salemove/kamailio/blame/master/src/modules/statsd/lib_statsd.c#L76,
    so it's initial result is not essential.

Note, that before 5.8 the result of init was already ignored due to
implicit conversion of false to 0
until after
0186246
was introduced (which could be considered a breaking change even if it
seemingly fixes a bug in conversion).


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3819

Commit Summary

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3819@github.com>