Persist.load should try the old file if the current file is empty
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Landscape Client |
Medium
|
Thomas Herve |
Bug Description
Right now, there is a simple return if the current file is empty. If we failed to write the content, we won't try to load the old file even if it's valid.
Related branches
- Alberto Donato: Approve on 2011-07-12
- Jerry Seutter (community): Approve on 2011-07-12
-
Diff: 97 lines (+59/-11)2 files modifiedlandscape/lib/persist.py (+19/-11)
landscape/lib/tests/test_persist.py (+40/-0)
Andreas Hasenack (ahasenack) wrote : | #1 |
Changed in landscape-client: | |
status: | In Progress → Fix Committed |
Andreas Hasenack (ahasenack) wrote : | #2 |
Verified with a special build I did of the client with only this patch, at https:/
I tried the forced reboot scenario of bug #788605, but couldn't reach a conclusion yet as I couldn't reproduce that specific problem reliably. Not with a stored script, nor with issuing that command at the console. I used ec2 instances, but not cloud registration, i.e., I used them as regular computers.
tags: | added: verified |
David Ayers (ayers) wrote : | #3 |
My eight month old notebook seems to have been subject to power consumption and now battery issues so now I'm seeing this issue quite often as it powers off far to quickly on the first warning before I'm able to shut the system down.
If it would help, I would attempt to test this package yet I'd need instructions on how to do it correctly to be able to revert again in case that's needed.
Andreas Hasenack (ahasenack) wrote : | #4 |
Hello David,
you can test the packages from this PPA: https:/
If you need to revert, just downgrade the packages back to the 11.02 version, it should work just fine.
David Ayers (ayers) wrote : | #5 |
Hello Andreas,
thanks a lot for packaging! I'm currently on maverick due to natty's kernel's power management issues so I could only test this with a fresh USB-Stick install. I can do that latest on Thursday since I'm currently traveling with expensive foreign prepaid UMTS connections.
But I'll get back to you on Thursday unless I do come by some hot-spot with time to install natty.
Thanks again!
Andreas Hasenack (ahasenack) wrote : | #6 |
David, FYI that PPA has maverick packages too.
Thanks for helping!
David Ayers (ayers) wrote : | #7 |
Thanks! I've installed the Maverick package of the PPA can confirm that since then the battery outages have not lead to my registration being lost!
Thanks!
Hello Thomas, or anyone else affected,
Accepted landscape-client into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https:/
tags: | added: verification-needed |
Andreas Hasenack (ahasenack) wrote : | #9 |
Verified with landscape-
root@ls1-
landscape-client:
Installed: 11.07.1.
Candidate: 11.07.1.
Version table:
*** 11.07.1.
500 http://
100 /var/lib/
11.
500 http://
1.
500 http://
I made sure the old file had valid content and corrupted the main one. Then restarted landscape-client. The old file was used correctly, and the client continued working normally and was still registered with the landscape server:
root@ls1-
* Stopping landscape-client daemon [ OK ]
root@ls1-
root@ls1-
root@ls1-
-rw------- 1 landscape landscape 0 2011-07-27 21:57 broker.bpickle
-rw------- 1 landscape landscape 865 2011-07-27 21:57 broker.bpickle.old
root@ls1-
* Starting the landscape-client daemon [ OK ]
root@ls1-
-rw------- 1 landscape landscape 865 2011-07-27 21:58 broker.bpickle
-rw------- 1 landscape landscape 0 2011-07-27 21:57 broker.bpickle.old
root@ls1-
root@ls1-
2011-07-27 21:59:10,086 INFO [MainThread] Starting urgent message exchange with https:/
2011-07-27 21:59:11,511 INFO [Dummy-1 ] Sent 13486 bytes and received 150 bytes in 1.42s.
2011-07-27 21:59:11,516 INFO [MainThread] Switching to normal exchange mode.
2011-07-27 21:59:11,518 INFO [MainThread] Message exchange completed in 1.43s.
tags: |
added: verification-done removed: verification-needed |
Jonathan Davies (jpds) wrote : | #10 |
I can also confirm that the fixed lucid-proposed package works as expected.
David Ayers (ayers) wrote : | #11 |
I currently have:
ayers@schiefer:~$ LANG=C apt-cache policy landscape-client
landscape-client:
Installed: 11.02-0ubuntu0.
Candidate: 11.02-0ubuntu0.
Version table:
*** 11.02-0ubuntu0.
900 http://
100 /var/lib/
1.
500 http://
installed and the issue is reoccuring. I have re-registered the my notebook twice in last 3 days due to battery/power management issues.
I'm not sure what to set the status to: confirmed?
Andreas Hasenack (ahasenack) wrote : | #12 |
The fix was only released to lucid, sorry. I'll try to get it out for the other releases soon.
Martin Pitt (pitti) wrote : | #13 |
Hello Thomas, or anyone else affected,
Accepted landscape-client into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https:/
tags: | removed: verification-done |
tags: | added: verification-needed |
Martin Pitt (pitti) wrote : | #14 |
Hello Thomas, or anyone else affected,
Accepted landscape-client into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https:/
Andreas Hasenack (ahasenack) wrote : | #15 |
Verified for Maverick and Natty using the package in proposed in the same way the verification for Lucid was done above. Works fine.
Changed in landscape-client: | |
status: | Fix Committed → Fix Released |
David Ayers (ayers) wrote : | #16 |
I can confirm that the packages in maverick-proposed fix the issue for me. I have tested it with a broken battery.
Just to note that bug #788605 was the original one about this and contains some discussion. It's not marked as a duplicate just yet.