miconda left a comment (kamailio/kamailio#4787)
Having both old and new (lists and hash tables) types of structure will make
the module more complex, rather have different modules than making the existing
one heavier to maintain.
I do not see the real benefits (maybe not yet), at least for `address` table
that I use to worth such a large change that is not easier to review and test
for stability. Also, for subnet matching, there is also match the longest one,
which means going over all records, so hash table vs list makes no difference.
Anyhow, I do not think the matching speed was an issue so far, and regarding
reloads, from the design of the PR I think that lookups can keep using an old
table while another process (e.g., rpc) frees it.
I recognize that you put a lot of effort in the PR and probably you see
benefits for your use case, the proposed variant with a different module was to
offer quicker the chance to people to test (eventually in parallel to compare).
Back to the design, with two level locks, one per table and one per bucket:
- if table-lock is acquired by each process using the table, then the
bucket-lock should not be necessary, but then only one process can use the
table at that moment, practically matching cannot be done in parallel anymore
- if table-lock is NOT acquired by each process using the table, then reloading
in parallel can result in races, with a process still accessing an old table
that is freed by another one
Have I understood it wrong? If yes, can you provide more details about what
locks are acquired on IP matching by a SIP worker process and what happens when
a RPC does a reload?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4787#issuecomment-4855099851
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4787/[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!