New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow start on full disk #271
Conversation
When disk is full, Sugar will not start, because the backup log
directory cannot be created.
X session logs in tmpfs show this exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/site-packages/jarabe/main.py", line 20, in <module>
logger.cleanup()
File "/usr/lib/python2.7/site-packages/sugar3/logger.py", line 113, in cleanup
os.mkdir(backup_dir)
OSError: [Errno 28] No space left on device: '/home/user/.sugar/default/logs/1448258018'
Fix is to ignore the exception.
We've been here before! Was previously fixed in 2010:
sugarlabs/sugar@4cde481
https://bugs.sugarlabs.org/ticket/1720
http://dev.laptop.org/ticket/9623
But new regression introduced in 2012 during reorganisation of
code by Daniel Narvaez; the exception was no longer handled:
sugarlabs/sugar@0e45f9d
sugarlabs/sugar@19db9c5
Reported-by: Nathan Riddle <nathanr333@charter.net>
Tested-by: James Cameron <quozl@laptop.org>
| os.rename(source_path, dest_path) | ||
| try: | ||
| os.mkdir(backup_dir) | ||
| for log in backup_logs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we put the renaming outside the try? Moving a file doesn't use space does it?
|
Looks like a good fix. See comments on the patch |
|
Yes, a rename may consume space, especially on jffs2. But if mkdir fails there's no point in doing rename, because the target directory probably does not exist. So then yet another try except is needed to protect the rename. Yes, "as e" is the new syntax, but that's a separate issue. I would reject a patch that used inconsistent coding style while fixing a bug. There are 17 other places in sugar-toolkit-gtk3 and 57 such in sugar. You might want to submit a patch for that later? |
|
OK, I'll merge this arvo. Re as: if ya want. It's not a biggie. We can probably wait until we want On Tue, Nov 24, 2015, 7:35 AM James Cameron notifications@github.com
|
When disk is full, Sugar will not start, because the backup log directory cannot be created.
X session logs in tmpfs show this exception:
Fix is to ignore the exception.
We've been here before! Was previously fixed in 2010:
But new regression introduced in 2012 during reorganisation of code by Daniel Narvaez; the exception was no longer handled:
Reported-by: Nathan Riddle nathanr333@charter.net
Tested-by: James Cameron quozl@laptop.org