File Locking

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

File Locking

Ted Felix-2
   Just finished implementing file locking (see bug #1510) to prevent
having a file open in two instances of rg.  I would appreciate any
testing anyone can do.  The change is in [r14576].  Grab the latest svn,
build, and use as you usually do.

   The obvious test case to see the new behavior is to launch rg twice
and try to open the same file with each instance.

   Thanks.

Ted.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Missing <iostream> in r14576 [WAS] Re: File Locking

Lorenzo Sutton
Hi,

On 31/03/2016 05:03, Ted Felix wrote:
>     Just finished implementing file locking (see bug #1510) to prevent
> having a file open in two instances of rg.  I would appreciate any
> testing anyone can do.  The change is in [r14576].  Grab the latest svn,
> build, and use as you usually do.

However, build fails here due to a bunch of files (mainly in
./src/document) missing #include <iostream>. E.e.g first one is:

http://paste.fedoraproject.org/347839/59429132/

16.02 builds fine.

>
>     The obvious test case to see the new behavior is to launch rg twice
> and try to open the same file with each instance.
>
>     Thanks.
>
> Ted.
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
> _______________________________________________
> Rosegarden-user mailing list
> [hidden email] - use the link below to unsubscribe
> https://lists.sourceforge.net/lists/listinfo/rosegarden-user
>

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: Missing <iostream> in r14576 [WAS] Re: File Locking

Ted Felix-2
On 03/31/2016 09:00 AM, Lorenzo Sutton wrote:
> However, build fails here due to a bunch of files (mainly in
> ./src/document) missing #include <iostream>. E.e.g first one is:

   Sorry.  This appears to be related to [r14567].  Workaround for now
appears to be doing a debug build (-DCMAKE_BUILD_TYPE=Debug).  I'll post
when this is resolved.

Ted.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Yves Guillemot
In reply to this post by Ted Felix-2
Le mercredi 30 mars 2016, 23:03:12 Ted Felix a écrit :
>    Just finished implementing file locking (see bug #1510) to prevent
> having a file open in two instances of rg.  I would appreciate any
> testing anyone can do.

>    The obvious test case to see the new behavior is to launch rg twice
> and try to open the same file with each instance.

I first tried the obvious case:

 - Open a file in a first RG instance
 - Try to open the same file from an other RG instance
 => Can't open the file in the new instance: a popup with a "could not lock
file" message is displayed.

 - Close the file in the first RG instance
 - Try again to open the file in the second instance
 => file is normally opened.

 - Kill the second instance (Ctrl-C)
 - Try to open the file in the first instance
 => Can't open the file, the popup is displayed.

 - rm the lock file (whose name is given in the popup)
 - Try again to open the file in the first instance
 => file is normally opened.

 - Create a new RG instance
 - Try to open the same file from this new instance
 => Can't open the file, the popup is displayed.


Then I tried a less obvious case:

 - Create a new composition in RG and save it in a file. Keep RG open.
 - Create again a new composition in another RG instance
 - Try to save the last composition in the same file as fhe first one.
 => Can't save the file, the popup is displayed.

 - Try again the same save operation
 => no more popup.

There is now two RG instances able to write alternatively in the same file.


So, except this last problem, it works fine here.

There is a small issue (repeatedly occurring with RG) about UTF8 garbage in
the displayed lock file name when the .rg file uses non ASCII characters (I did
the first test with a file name containing a diacritic).

An other (very) small problem is the "Could not lock file" message which may be
unclear for some users.
An improvment should be to add in the popup a first sentence explaining that
two different RG instances try to access the same file.

Yves




------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Ted Felix-2
On 03/31/2016 09:45 AM, Yves Guillemot wrote:
> Then I tried a less obvious case:

   Thanks for finding that.  I'll have a look.

> There is a small issue (repeatedly occurring with RG) about UTF8 garbage in
> the displayed lock file name when the .rg file uses non ASCII characters (I did
> the first test with a file name containing a diacritic).

   OK, I figured somebody would find something like this.  Is there
something we can do about this?

> An other (very) small problem is the "Could not lock file" message which may be
> unclear for some users.
> An improvment should be to add in the popup a first sentence explaining that
> two different RG instances try to access the same file.

   The wording is just a rough draft, so suggestions are definitely
appreciated.  I'll see what I can come up with.

Ted.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Ted Felix-2
In reply to this post by Yves Guillemot
On 03/31/2016 09:45 AM, Yves Guillemot wrote:
> An other (very) small problem is the "Could not lock file" message which may be
> unclear for some users.
> An improvment should be to add in the popup a first sentence explaining that
> two different RG instances try to access the same file.

   How about this:

"Could not lock file.  Another user or instance of Rosegarden may
already be editing this file.  If you are sure no one else is editing
this file, delete the lock file and try again."

Ted.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

D. Michael McIntyre-3
On 03/31/2016 04:00 PM, Ted Felix wrote:

>     How about this:
>
> "Could not lock file.  Another user or instance of Rosegarden may
> already be editing this file.  If you are sure no one else is editing
> this file, delete the lock file and try again."

That seems closer.

I haven't had time to test any of the newest work on file locking.  I
hope to do so soon.
--
D. Michael McIntyre

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Yves Guillemot
In reply to this post by Ted Felix-2
Le jeudi 31 mars 2016, 15:53:23 Ted Felix a écrit :
> On 03/31/2016 09:45 AM, Yves Guillemot wrote:
> > the displayed lock file name when the .rg file uses non ASCII characters
> > (I did the first test with a file name containing a diacritic).
>
>    OK, I figured somebody would find something like this.  Is there
> something we can do about this?

Usually QString::fromStdString() does the conversion.

Yves

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Yves Guillemot
In reply to this post by Ted Felix-2
Le jeudi 31 mars 2016, 16:00:12 Ted Felix a écrit :
>
>    How about this:
>
> "Could not lock file.  Another user or instance of Rosegarden may
> already be editing this file.  If you are sure no one else is editing
> this file, delete the lock file and try again."
>

Seems very good to me.

Yves


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

D. Michael McIntyre-3
In reply to this post by Yves Guillemot
On 03/31/2016 05:34 PM, Yves Guillemot wrote:

>>     OK, I figured somebody would find something like this.  Is there
>> something we can do about this?
>
> Usually QString::fromStdString() does the conversion.

Meant to mention I'll be happy to fiddle with that part of it if you
don't get it worked out, Ted.

--
D. Michael McIntyre

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Ted Felix-2
On 03/31/2016 06:29 PM, D. Michael McIntyre wrote:
> On 03/31/2016 05:34 PM, Yves Guillemot wrote:
>> Usually QString::fromStdString() does the conversion.
> Meant to mention I'll be happy to fiddle with that part of it if you
> don't get it worked out, Ted.

   I'll leave it up to you.  Feel free to tweak the message text too.  I
don't anticipate any further changes near those areas, so conflicts are
unlikely.

Ted.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Kevin Donnelly
In reply to this post by Ted Felix-2
Hi Ted

On 31/03/16 21:00, Ted Felix wrote:
> How about this: "Could not lock file. Another user or instance of
> Rosegarden may already be editing this file. If you are sure no one
> else is editing this file, delete the lock file and try again."

The only thing I'd suggest is that it might be handy to give the
location of the lock file.

--
Kevin Donnelly
kevindonnelly.org.uk
cymraeg.org.uk


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Ted Felix-2
On 04/01/2016 03:49 AM, Kevin Donnelly wrote:
> The only thing I'd suggest is that it might be handy to give the
> location of the lock file.

   Absolutely.  It's actually in there.  I just removed it to focus the
discussion on the explanation.  It also displays the user/time/host that
created the lock so you can walk over to their "office" and ask if they
are really still working on that file from three days ago.  All of this
is also in the lock file as plain text so you can just "cat" it to
figure out what's going on.

Ted.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Abrolag
On Fri, 1 Apr 2016 06:33:11 -0400
Ted Felix <[hidden email]> wrote:

> On 04/01/2016 03:49 AM, Kevin Donnelly wrote:
> > The only thing I'd suggest is that it might be handy to give the
> > location of the lock file.  
>
>    Absolutely.  It's actually in there.  I just removed it to focus the
> discussion on the explanation.  It also displays the user/time/host that
> created the lock so you can walk over to their "office" and ask if they
> are really still working on that file from three days ago.  All of this
> is also in the lock file as plain text so you can just "cat" it to
> figure out what's going on.
>
> Ted.
>

Well that completely answers the questions I was going to ask! Good forward
thinking :)

--
W J G

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

D. Michael McIntyre-3
In reply to this post by Ted Felix-2
On 03/31/2016 08:08 PM, Ted Felix wrote:

>     I'll leave it up to you.  Feel free to tweak the message text too.  I
> don't anticipate any further changes near those areas, so conflicts are
> unlikely.

I WILL have a look, I just don't know what month quite yet.

--
D. Michael McIntyre

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Ted Felix-2
In reply to this post by Yves Guillemot
On 03/31/2016 09:45 AM, Yves Guillemot wrote:

> Then I tried a less obvious case:
>
>   - Create a new composition in RG and save it in a file. Keep RG open.
>   - Create again a new composition in another RG instance
>   - Try to save the last composition in the same file as fhe first one.
>   => Can't save the file, the popup is displayed.
>
>   - Try again the same save operation
>   => no more popup.
>
> There is now two RG instances able to write alternatively in the same file.

   This should be fixed as of [r14586].

Ted.

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Ted Felix-2
In reply to this post by Yves Guillemot
On 03/31/2016 09:45 AM, Yves Guillemot wrote:
> There is a small issue (repeatedly occurring with RG) about UTF8 garbage in
> the displayed lock file name when the .rg file uses non ASCII characters (I did
> the first test with a file name containing a diacritic).

   I'm testing with diacritics in Ubuntu with no trouble.  The lock file
name in the message box matches the lock filename exactly.  No UTF-8
garbage.  Is this a distro-related problem?  Or am I testing with the
wrong diacritics?  My test file is named:

   test-dīácrítícs.rg

Ted.

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

D. Michael McIntyre-3
On 04/05/2016 10:54 PM, Ted Felix wrote:

>     I'm testing with diacritics in Ubuntu with no trouble.  The lock file
> name in the message box matches the lock filename exactly.  No UTF-8
> garbage.  Is this a distro-related problem?  Or am I testing with the
> wrong diacritics?  My test file is named:
>
>     test-dīácrítícs.rg

Same result here.  I tried a bunch of random weird stuff.  I can prevent
Rosegarden from being able to load a file by changing its encoding to
something awful, but everything else I tried just works.

Could be locale- and/or filesystem-related.  I don't have any weird
filesystems to test, like an old partition that was created before utf-8
became the norm.  I used to have one of those, and that's what I'm
betting might cause breakage.  Haven't had that for a long time.

--
D. Michael McIntyre

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Yves Guillemot
Le mercredi 6 avril 2016, 06:02:18 D. Michael McIntyre a écrit :

> On 04/05/2016 10:54 PM, Ted Felix wrote:
> >     I'm testing with diacritics in Ubuntu with no trouble.  The lock file
> >
> > name in the message box matches the lock filename exactly.  No UTF-8
> > garbage.  Is this a distro-related problem?  Or am I testing with the
> >
> > wrong diacritics?  My test file is named:
> >     test-dīácrítícs.rg
>
> Same result here.  I tried a bunch of random weird stuff.  I can prevent
> Rosegarden from being able to load a file by changing its encoding to
> something awful, but everything else I tried just works.
>
> Could be locale- and/or filesystem-related.

It is locale related.

My distro (Mageia 5) offered two options for locales:
   - The default mode where filenames are encoded with UTF8
   - The "Compatibility with old encoding" mode where filenames are encoded
with ASCII or ISO-something.

In the first mode, my locale is LANG=fr_FR.UTF-8.
In the second mode it is LANG=fr_FR.

Filenames may contain diacritics in the two modes, but utf8 garbages are only
found with the first one.

The problem should be fixed in rev. 14587.

Yves



------------------------------------------------------------------------------
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
Reply | Threaded
Open this post in threaded view
|

Re: File Locking

Yves Guillemot
In reply to this post by Ted Felix-2
Le mardi 5 avril 2016, 21:56:48 Ted Felix a écrit :
>    This should be fixed as of [r14586].

Works fine here.
 
Yves


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-user mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user
12