Re: [PATCH] Support for MO direction 'group = smsbox-route' reloading (aka graceful restart)

Stipe Tolj <[email protected]> Sat, 03 Nov 2018 17:18:10 +0100
Newsgroups gmane.comp.mobile.kannel.devel
Organization Kannel Foundation
Message-ID <[email protected]>
Am 17.10.18 10:42, schrieb Stipe Tolj:
>
> hmm, yes we do this intentionally actually.
>
> We destroy the structures, then re-parse the 'group = smsbox-route'
> groups from the configuration. If a group has an error, we only dump the
> error but continue to parse the following groups.
>
> A restart would formally break via PANIC, since the config has an issue.
> But we keep on going with all groups that are configured correctly.
>
> I'm assuming you would rather re-parse the new config, and ONLY if it
> has no error swap the new config with the old one. If it contains an
> error rather keep running the old one?
>
>> 2. if I see reload configs without a lock… Uhh I can construct soo many
>> cases, e.g. smsc is renamed in new config but still used in the old
>> smsbox group, etc. etc.
>>
>> int bb_graceful_restart(void)
>> {
>> - return smsc2_graceful_restart();
>> + Cfg *cfg;
>> +
>> + info(0, "Reloading configuration resource `%s'.",
>> octstr_get_cstr(cfg_filename));
>> + cfg = cfg_create(cfg_filename);
>> + if (cfg_read(cfg) == -1) {
>> + error(0, "Error processing configuration resource `%s'. Continue with
>> existing configuration.",
>> + octstr_get_cstr(cfg_filename));
>> + return -1;
>> + }
>> +
>> + smsc2_graceful_restart(cfg);
>> + smsbox_restart(cfg);
>> + return 0;
>> }
>
> the smsbox_restart() locks down via
>
> gw_rwlock_wrlock(smsbox_list_rwlock);
>
> and the MO receiving part do route_incoming_to_boxc(), which sets:
>
> gw_rwlock_rdlock(smsbox_list_rwlock);
>
> so we SHOULD never be in a race-condition where we would try to get a MO
> routing and the structures are destroyed in the middle of the process.
> Right?
>
> I don't understand the argument with "smsc is renamed in new config but
> still used in the old smsbox group". Could you please explain?

Hi Alex,

any update here from your side?

Thanks,
Stipe

-- 
Best Regards,
Stipe Tolj

-------------------------------------------------------------------
Düsseldorf, NRW, Germany

Kannel Foundation                 tolj.org system architecture
http://www.kannel.org/            http://www.tolj.org/

[email protected]                  [email protected]
-------------------------------------------------------------------