GTG

Data lost if multiple instances are running

Bug #340557 reported by Ben Lau
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Critical
Unassigned

Bug Description

In my understanding , gtg-0.1 write data when the application closed. If there are multiple instances running. The last one closed will override the whole data file. The changes of previous instance will be loss.

Step to reproduce the problem:

1. Open two gtg instances
2. In the gtg instance 1 , add a task called "Test case 1"
3. In the gtg instance 2 , add a task called "Test case 2"
4. Close gtg instance 2
5. Close gtg instance 1

6. Open new gtg instance , you will found that "Test case 2" is missed in the task list.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

I confirm this. This will be solved by using DBUS so only one instance of GTG will be launched.

Changed in gtg:
assignee: nobody → ploum
importance: Undecided → High
milestone: none → 0.2
status: New → Confirmed
Changed in gtg:
importance: High → Critical
Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

In the meantime, why not implement a preventive measure like Specto's process ID lockfile? For example, see the check_instance method in http://bazaar.launchpad.net/%7Especto/specto/main/annotate/head%3A/spectlib/main.py near line #187.

Changed in gtg:
milestone: 0.2 → 0.1.2
status: Confirmed → In Progress
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

fixed in rev 252.

It is not ideal as it does nothing gtg is already started. Instead, it should expose the already opened browser window. But it will be possible only when we will have proper dbus support.

Changed in gtg:
status: In Progress → Fix Committed
Revision history for this message
Mikolaj Kucharski (mikolaj-kucharski) wrote :

Hi,

Cannot you use SIGUSR1 to notify already started GTG process that it
should be exposed? What I mean here is:

1. GTG is running
2. User is starting another GTG process
3. New GTG is checking does any other GTG is running
4. Yes it's running, so it is sending SIGUSR1 to already running process
5. Already running GTG is receiving SIGUSR1 and is notifying a user
6. New GTG is exiting, as it has nothing more todo

Cheers,
 Mikolaj

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Mikolaj : we could but it seems complicated. If you have some sample code doing that in python, I will have a look at it.

Revision history for this message
Mikolaj Kucharski (mikolaj-kucharski) wrote :

Sorry, I can't. No python programming skills :/

Revision history for this message
Ben Lau (benlau) wrote :

I think we don't need to use SIGUSR1 approach as it is already planned to implement dbus. It could make a dbus call which will bring already running GTG to go to top. When second process is launched, it will found that the session is already registered by another process , then it could make use of that dbus call to ask the already running process to go to top.

Revision history for this message
Zach Shepherd (eightball1989) wrote :

Is there any interest in a temporary lockfile-based fix? That would prevent people from loosing data while dbus is implemented.

Revision history for this message
Zach Shepherd (eightball1989) wrote :

Scratch that. I should have read the comments more carefully.

Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote : Re: [Bug 340557] Re: Data lost if multiple instances are running

Since I don't know when we'll have time to implement DBUS
verification, a quick lockfile hack could be nice. I guess it should
not be very complicated. Would you be interested in implementing it?

On Wed, Jun 24, 2009 at 6:02 PM, Zach Shepherd <email address hidden> wrote:
>
> Is there any interest in a temporary lockfile-based fix? That would
> prevent people from loosing data while dbus is implemented.
>
> --
> Data lost if multiple instances are running
> https://bugs.launchpad.net/bugs/340557
> You received this bug notification because you are a member of Gtg
> developers, which is the registrant for Getting Things GNOME!.
>
> Status in Getting Things GNOME!: Fix Committed
>
> Bug description:
> In my understanding , gtg-0.1 write data when the application closed. If there are multiple instances running. The last one closed will override the whole data file. The changes of previous instance will be loss.
>
> Step to reproduce the problem:
>
> 1. Open two gtg instances
> 2. In the gtg instance 1 , add a task called "Test case 1"
> 3. In the gtg instance 2 , add a task called "Test case 2"
> 4. Close gtg instance 2
> 5. Close gtg instance 1
>
> 6. Open new gtg instance , you will found that "Test case 2" is missed in the task list.

--
Bertrand Rousseau
Place communale 1, 1450 Chastre, Belgium
e-mail : <email address hidden>
tel : +32 485 96 69 86

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Bertrand, I (you know ? your co-maintener ?) implemented it last week and this bug is fixed. I think you should get more sleep and a pizza tomorrow :-)

Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote :

Oops, sorry, I got confused somehow, as the discussion went on on this
bug. Is the solution using DBUS?

On Wed, Jun 24, 2009 at 11:21 PM, Lionel Dricot <email address hidden> wrote:
>
> Bertrand, I (you know ? your co-maintener ?) implemented it last week
> and this bug is fixed.   I think you should get more sleep and a pizza
> tomorrow :-)
>
> --
> Data lost if multiple instances are running
> https://bugs.launchpad.net/bugs/340557
> You received this bug notification because you are a member of Gtg
> developers, which is the registrant for Getting Things GNOME!.
>
> Status in Getting Things GNOME!: Fix Committed
>
> Bug description:
> In my understanding , gtg-0.1 write data when the application closed. If there are multiple instances running. The last one closed will override the whole data file. The changes of previous instance will be loss.
>
> Step to reproduce the problem:
>
> 1. Open two gtg instances
> 2. In the gtg instance 1 , add a task called "Test case 1"
> 3. In the gtg instance 2 , add a task called "Test case 2"
> 4. Close gtg instance 2
> 5. Close gtg instance 1
>
> 6. Open new gtg instance , you will found that "Test case 2" is missed in the task list.

--
Bertrand Rousseau
Place communale 1, 1450 Chastre, Belgium
e-mail : <email address hidden>
tel : +32 485 96 69 86

Changed in gtg:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.