[Dev] Preventing user from running multiple instances

Andi Vajda vajda at osafoundation.org
Wed Mar 2 12:01:15 PST 2005


> It would be nice, if that became the default, that when a second Chandler is 
> started, the first one popped to the front instead. The repository reports an 
> ExclusiveOpenDeniedError on the second open.

Correction: It reports an ExclusiveOpenDeniedError if there is any other 
Chandler running in exclusive or non exclusive mode and you try to open a 
second one in exclusive mode. It reports a RepositoryOpenDeniedError if there 
is another Chandler running in exclusive mode and you try to open a second 
Chandler, exclusive or not.

Andi..


>
> Andi..
>
>> 
>> On Mar 2, 2005, at 11:26 AM, Andi Vajda wrote:
>> 
>>> 
>>>> For various reasons we don't want the user to be able to run multiple 
>>>> instances of Chandler against the same repository.  For example, if you 
>>>> fire up two instances at the same time, one of them will complain that 
>>>> //Schema already exists, and there are other places where things don't 
>>>> quite work.  So I was wondering if anyone had an idea for a 
>>>> cross-platform way to prevent multiple concurrent instances accessing a 
>>>> repository. Chandler could look for and create a lock file next to the 
>>>> repository directory, and place its process ID in there, thereby allowing 
>>>> it to detect whether an existing lock file is obsolete because a previous 
>>>> instance died without removing it.  (Does Windows have the notion of 
>>>> PID?) This method leaves the repository itself out of it -- purely an 
>>>> application level function.  Or we could get the repository involved and 
>>>> have it keep track of which process has it open, and the application 
>>>> layer asks the repository.  I guess I would lean toward the former 
>>>> method.
>>>> 
>>>> I'm sure there must be some python module that does this already, in a 
>>>> cross-platform way...
>>> 
>>> This is an old problem that I fixed a few months ago. If you don't want 
>>> multiple Chandlers to run concurrently, start the first one with -x or 
>>> --exclusive.
>>> 
>>> Andi..
>>> 
>>>> 
>>>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>>>> 
>>>> Open Source Applications Foundation "Dev" mailing list
>>>> http://lists.osafoundation.org/mailman/listinfo/dev
>>>> 
>>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>>> 
>>> Open Source Applications Foundation "Dev" mailing list
>>> http://lists.osafoundation.org/mailman/listinfo/dev
>> 
>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>> 
>> Open Source Applications Foundation "Dev" mailing list
>> http://lists.osafoundation.org/mailman/listinfo/dev
>> 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "Dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/dev
>



More information about the Dev mailing list