Hello,
https://www.kamailio.org/docs/modules/devel/modules/htable#htable.p.htable says for
modparam('htable', 'htable', '…autoexpire … updateexpire…')
autoexpire -time in seconds to delete an item from a hash table if no update was done to it. If is missing or set to 0, the items won't expire.
updateexpire - if set to 1 (default), the time until expiration of an item is reset when that item is updated. Certain uses of htable may dictate that updates should not reset the expiration timeout, however, in which case this attribute can be set to 0.
My reading is that, when a value is updated and autoexpire is positive, autoexpire will reset the timer, but updateexpire may or may not reset the same timer.
That is:
modparam('htable', 'htable', 'a=>autoexpire=5;updatedelete=1') modparam('htable', 'htable', 'b=>autoexpire=5;updatedelete=0')
If b was not updated for 5s, will it be removed, as the documentation for autoxpire suggests, irrespective of updatedelete?
Greetings Dilyan
Hello,
there is no updatedelete in the htable module.
The updateexpire should be set to 0 when you want the item to be removed always after the expire interval. Otherwise, an update to the item result in prolonging its lifetime with another expire interval.
Cheers, Daniel
On 06.02.23 08:08, Дилян Палаузов wrote:
Hello,
https://www.kamailio.org/docs/modules/devel/modules/htable#htable.p.htable says for
modparam('htable', 'htable', '…autoexpire … updateexpire…')
autoexpire -time in seconds to delete an item from a hash table if no update was done to it. If is missing or set to 0, the items won't expire.
updateexpire - if set to 1 (default), the time until expiration of an item is reset when that item is updated. Certain uses of htable may dictate that updates should not reset the expiration timeout, however, in which case this attribute can be set to 0.
My reading is that, when a value is updated and autoexpire is positive, autoexpire will reset the timer, but updateexpire may or may not reset the same timer.
That is:
modparam('htable', 'htable', 'a=>autoexpire=5;updatedelete=1') modparam('htable', 'htable', 'b=>autoexpire=5;updatedelete=0')
If b was not updated for 5s, will it be removed, as the documentation for autoxpire suggests, irrespective of updatedelete?
Greetings Dilyan __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hello Daniel,
thanks for your answer. This still confuses me:
autoexpire -time in seconds to delete an item from a hash table if no update was done to it. If is missing or set to 0, the items won't expire.
Has autoexpire something to do with last update? Do I understand correctly that:
- autoexpire determines if items are removed in general, independent of the last update, and - updateexpire sets, whether last update is relevant when deciding on removing an item?
If my understanding is correct, then the word “update” shall be removed from the description of “autoexpire”.
Example: modparam('htable', 'htable', 'a=>autoexpire=5;updateexpire=1') modparam('htable', 'htable', 'b=>autoexpire=5;updateexpire=0')
X="Y" is inserted into a and b: $sht(a=>X) = "Y" $sht(b=>X) = "Y"
Two seconds later a[X] and b[X] are updated to 'Z' $sht(a=>X) = "Z" $sht(b=>X) = "Z"
Three seconds later b[X] is removed, and a[X] is kept.
Greetings Dilyan
-----Original Message----- From: Daniel-Constantin Mierla miconda@gmail.com Reply-To: miconda@gmail.com To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org, Дилян Палаузов dpa-kamailio@bapha.be Subject: Re: [SR-Users] htable: autoexpire vs updatedelete Date: 02/06/2023 10:17:03 AM
Hello,
there is no updatedelete in the htable module.
The updateexpire should be set to 0 when you want the item to be removed always after the expire interval. Otherwise, an update to the item result in prolonging its lifetime with another expire interval.
Cheers, Daniel
On 06.02.23 08:08, Дилян Палаузов wrote:
Hello,
https://www.kamailio.org/docs/modules/devel/modules/htable#htable.p.htable%C... for
modparam('htable', 'htable', '…autoexpire … updateexpire…')
autoexpire -time in seconds to delete an item from a hash table if no update was done to it. If is missing or set to 0, the items won't expire.
updateexpire - if set to 1 (default), the time until expiration of an item is reset when that item is updated. Certain uses of htable may dictate that updates should not reset the expiration timeout, however, in which case this attribute can be set to 0.
My reading is that, when a value is updated and autoexpire is positive, autoexpire will reset the timer, but updateexpire may or may not reset the same timer.
That is:
modparam('htable', 'htable', 'a=>autoexpire=5;updatedelete=1') modparam('htable', 'htable', 'b=>autoexpire=5;updatedelete=0')
If b was not updated for 5s, will it be removed, as the documentation for autoxpire suggests, irrespective of updatedelete?
Greetings Dilyan __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: