kmteras left a comment (kamailio/kamailio#4809)
I'll provide some background on this from our use-case as @kuzaxak's coworker
as well to maybe restart the discussion besides the LLM topic:
We have E2E testing suites which include Kamailio in the E2E flows. To test
different scenarios quickly, tests all create their own dispatcher with
different allowed addresses. We were aware of the delta of permissions RPC
reload but wanted to lower it as even the default of 5s doubled the test
duration and caused some issues with detecting when a reload happened compared
to being blocked by reload delta.
> Probably it would be better to set that one by default to a "safety" value
> (like 10) and then let people tune it if they know what they do in case they
> need shorter rate limiting or parallel rpc execution.
Just to be clear, the default of 5s still seemed "safe" and we only faced the
issues when lowering it. Eventually we ended at 1s when this issues started
happening.
> An alternative implementation to add a lock for executing rpc commands could
> be coded.
This is what we implemented internally as a patch and have been now running
with a reload delta of 0 in our testing environment allowing for "instantaneous
reloads" and speeding up our test suites.
The permissions reload was actually less of a problem for us. The other issue
of [dispatcher reload](https://github.com/kamailio/kamailio/issues/4807) is
related to this and caused us a lot more trouble. That one could also be
triggered through `ds_reload()` and not just RPC as the problem (what we
identified as a TOCTOU race) is shared for both paths:
Checking of `(*ds_crt_idx) != (*ds_next_idx)` and assignment of `*ds_next_idx =
(*ds_crt_idx + 1) % 2;`.
https://github.com/kamailio/kamailio/blob/master/src/modules/dispatcher/dispatch.c#L1244-L1262
To overcome that, we also implemented a locking solution in the dispatcher
reload logic.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4809#issuecomment-4914518815
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4809/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the
sender!