rate_ctr_group_alloc with identical index doesn't return error
As seen by the bug fixed in Change-Id I1b56f8d7b47597ed263e6808074483edca0895de of osmo-bts.git, (https://gerrit.osmocom.org/#/c/5344) the rate_ctr_group_alloc() function appears to accept allocation of the same counter group for identical index, which is of course an error.
Let's make sure we return an error, and also make sure that all known callers actually deal with the error somehow (e.g. if the BTS counters couldn't be allocated, the entire BTS allocation should fail).
Do not allocate already existing counter group
Check that no group with the given name and index already exist before
allocating it. Add corresponding test case.
Fix tests after rate_ctr change
Recent change lin libosmocore disallow registering rate_ctr with the
same name and indexing multiple times. To accommodate to this:
- allocate network struct once and use it for all tests
- deregister rate_ctr group after each test
- free bts struct after each test
Use connection id when allocating rate counters
Due to recent libosmocore's change we can't allocate rate counters with
the same name and index which are already allocated. This causes
sgsn_mm_ctx_alloc_iu() failure for multiple subscribers.
Fix this by using conn_id parameter from ranap_ue_conn_ctx.
gtphub: make rate_ctr unique
- compute unique rate counter index when allocating new gtphub tunnel
- propagate rate counter allocation error to upper layers
- log and gracefully handle tunnel allocation error
#1 Updated by msuraev over 3 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 50
Fix for the library is available in gerrit 5418. We should also make sure that all the callers properly check and handle allocation error (which they should because there're other error paths in allocation function as well).