[OpenSER-Devel] concurrency issues in lcr

Dan Pascu dan at ag-projects.com
Fri May 16 10:43:39 CEST 2008


On Friday 16 May 2008, Juha Heinanen wrote:
> Dan Pascu writes:
>  > This line in reload_gws() is not atomic:
>  >
>  >     (*lcrs_ws_reload_counter)++;
>  >
>  > An atomic counter should be used for that, otherwise the value of
>  > lcrs_ws_reload_counter may end up with the wrong value if 2
>  > concurrent processes modify it in a narrow time window.
>
> dan,
>
> this is a known issue and the same holds true for reloading domains in
> domains module, where it is even documented.  a lock was not used
> because it was thought that reloads are result of human action and
> therefore are not likely to happen simultaneously.

Are you assuming that only one human operator has access to the system to 
issue the command, or that only one human operator at a time uses a 
provisioning interface to do changes? What about a multi domain system 
where each domain is under the control of a reseller and each reseller 
has complete and independent control over managing his domains and lcrs. 
How do you synchronize their operations to guarantee this? Unless you are 
the only admin of your site and you do not trigger a reload from a 
provisioning system that may be used by multiple persons, but you only 
manually run it as the only admin, I see no way in which this can be 
guaranteed to be "not likely".

IMO this is a poor design to have the internal consistency of the program 
depend on the way an external MI command is issued.

-- 
Dan



More information about the Devel mailing list