Open ar45 opened 2 years ago
How many acc_extra do you have? Issue like you have can be if there are more than 64 such vars.
@bogdan-iancu I expected such behaviour when I had more than #define MAX_ACC_EXTRA 64
variables.
It would be good to add check and log message.
Another issue is that currently if you change the order of acc_extra fields, all mid dialog sessions will mix up the values.
On Wed, Nov 17, 2021, 2:34 PM Nick Altmann @.***> wrote:
@bogdan-iancu https://github.com/bogdan-iancu I expected such behaviour when I had more than #define MAX_ACC_EXTRA 64 variables. It would be good to add check and log message.
β You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips/issues/2691#issuecomment-971974737, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFR6GBUIJCXZIBNWWBOWBLUMQGW5ANCNFSM5IHZFENQ .
Please use one issue per ticket.
Another issue is that currently if you change the order of acc_extra This is not issue, but design. Dialogs keep accounting variables ordered. If you change order of them, old dialogs will mix up the values.
Just don't do this.
Nick, I hear what you are saying, but this means you can never make changes to production live machine unless there are no active calls.
On Wed, Nov 17, 2021, 4:27 PM Nick Altmann @.***> wrote:
Please use one issue per ticket.
Another issue is that currently if you change the order of acc_extra This is not issue, but design. Dialogs keep accounting variables ordered. If you change order of them, old dialogs will mix up the values.
Just don't do this.
β You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips/issues/2691#issuecomment-972158585, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFR6GAXA7IDBYK4LR3GMS3UMQT6TANCNFSM5IHZFENQ .
I consider this an issue. The design is an implementation technicality.
Also, I'm not discussing this on the GitHub ticket.
It's the mailing list and pointing out a broader issue within the same context :)
On Wed, Nov 17, 2021, 4:31 PM Podrigal, Aron @.***> wrote:
Nick, I hear what you are saying, but this means you can never make changes to production live machine unless there are no active calls.
On Wed, Nov 17, 2021, 4:27 PM Nick Altmann @.***> wrote:
Please use one issue per ticket.
Another issue is that currently if you change the order of acc_extra This is not issue, but design. Dialogs keep accounting variables ordered. If you change order of them, old dialogs will mix up the values.
Just don't do this.
β You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips/issues/2691#issuecomment-972158585, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFR6GAXA7IDBYK4LR3GMS3UMQT6TANCNFSM5IHZFENQ .
@nikbyte , @ar45 , as I see it, the issue is not the 64 limit, but the fact that during the call, OpenSIPS is restarted with a different set of extra / leg acc vars. This will conflict (and crash) as the acc context that was created with the original set and restored after restart will have a different number of keys when being used after restart. In this particular case, it will look for one more extra val which actually does not exists in the acc context.
@bogdan-iancu can we store in the acc context the keys and order of how it was when initialized, and then check it to match when restarted?
This will help both issues, A) not go over more than the amount of keys which exists in the acc context B) if a key was removed, or keys were reordered, we can reorder them when restoring / reloading the acc context to match after restart.
@bogdan-iancu then we have two issues to fix and good opportunity to fix them together. π
@ar45 , storing also the keys maybe escalate the memory usage (to store the same data for each call), considering the fact there is no way to change the set of keys during runtime. Maybe adding some extra info on the number of keys stored in the context, to avoid overflowing when adding more keys. Of course, this will not solve the problem when you change the order of the keys.
How about computer a hash of all the keys on start and store that on the dialogue so we can compare that when restoring?
Also, we only need this info when saving dialog to database upon shutting down opensips so we have it when restarting..
On Fri, Nov 19, 2021, 2:24 AM Bogdan Andrei IANCU @.***> wrote:
@ar45 https://github.com/ar45 , storing also the keys maybe escalate the memory usage (to store the same data for each call), considering the fact there is no way to change the set of keys during runtime. Maybe adding some extra info on the number of keys stored in the context, to avoid overflowing when adding more keys. Of course, this will not solve the problem when you change the order of the keys.
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips/issues/2691#issuecomment-973858764, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFR6GGQAUVB6UAFN27MFLDUMYCTFANCNFSM5IHZFENQ .
@razvancrainea is looking a bit deeper into this, to see what our options are.
Thanks @bogdan-iancu @razvancrainea
There are 2 issues
For issue 2, I thought of a workaround,
the first acc_extra tag name will always be extra_tags_version
I will always initialize that at the beginning of the dialog.
I will add a script route acc_check_dlg_version_match
, that will run for every in-dialog request. within this route, I will check the version number of the $acc(extra_tags_version)
with the STATIC value (I will be incrementing each time I make a change). If the change requires moving values from the old acc_extra tagenames to the new ones, I will do that here.
In the rare case a DB accounting record will be created without this script route running. I can later check the db record insertion time, correlating that with the acc_extra_version number the dialog has been created with, and fixup the values in the db by manually moving the field values accordingly.
This is not a simple process, and is very error prone, I wish we can come up with a better solution.
Maybe, opensips can do that automatically. Maybe adding
mod_param("acc", "acc_extra_version", 3);
mod_param("acc", "acc_extra_version_update_route", "ROUTE_NAME_TO_RUN_WHEN_VERSION_MISMATCH");
and populate $dlg_acc_extra(old-tag-name)
with the values and tags as was with previous version.
# this route will run every time a dialog acc context is loaded and the acc context version does not match the existing `acc_extra_version`
route[ROUTE_NAME_TO_RUN_WHEN_VERSION_MISMATCH] {
# User can check and use there own logic for how to update the acc_extra variables from previous version to make it compatible with new version
if ($dlg_acc_extra_version == 1) {
$acc_extra("var1") = $dlg_acc_extra("var2");
} else if ($dlg_acc_extra_version == 2) {
$acc_extra("var1") = $dlg_acc_extra("something-else");
}
}
Once there are no dialogs with a certain tag version in use, that record can be removed from db.
Just brainstorming.
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
Still waiting
On Wed, Dec 8, 2021, 12:41 AM github-actions[bot] @.***> wrote:
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips/issues/2691#issuecomment-988542450, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFR6GCVYAPS2XONSLMT23LUP342RANCNFSM5IHZFENQ .
Hi, @ar45 !
Apologies for getting back after such a long period - I was caught with other tasks and I honestly didn't get to write my thoughts down. The main idea is indeed to avoid any crashes. In order to address this issue, there are two components that we need to consider: A. master branch, and B. stable releases. For the master branch, there are several things we can do, and my suggestion is to have a configurable way of storing accounting in dialog:
The problem however is that changing the layout of how values are stored will break compatibility with previous versions - and this is quite a sensitive matter when it comes to accounting. That's why for stable releases, we need to have a different approach - our proposal is to write some sort of cookie in the layout of the value that can help us to understand if there is an old format, or a new one, which will consist of the number of values (solution 1 in master).
Any other ideas, considering the back-porting limitations, are welcome.
Best regards, RΔzvan
@razvancrainea this sounds good.
In regards to keeping track of the config keys and order. Can opensips store this in the db on startup and then re-parse that.
The idea is that acc_extra will have multiple definitions of the tag names and each one associated with a version corresponding in the dialog.
Another method would be to have a config table where we would specify the acc_extra instead and opensips would set a marker on startup if there are no dialogs using a specific definition indicating it is safe to delete.
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
yes
On Sun, Dec 26, 2021 at 12:41 AM github-actions[bot] < @.***> wrote:
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
β Reply to this email directly, view it on GitHub https://github.com/OpenSIPS/opensips/issues/2691#issuecomment-1001113771, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFR6GCIWRBT7PHTBRAV2LLUS22HZANCNFSM5IHZFENQ . You are receiving this because you were mentioned.Message ID: @.***>
--
- Aron Podrigal
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
Yeah, still waiting to get some time to work on this.
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
Still waiting
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
yes
Still waiting
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
OpenSIPS version you are running
Crash Core Dump
Bellow is the relevant traceback
Describe the traffic that generated the bug
Crashes here https://github.com/OpenSIPS/opensips/blob/master/modules/acc/acc.c#L245
A call mid dialog, after adding a acc_extra field and restarting, then the dialog acc ctx does not have sufficient values matching the
extra->tag_idx
count and segfaultsTo Reproduce
Relevant System Logs