New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 701290 link

Starred by 6 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Feature

Blocking:
issue 701293
issue 673859



Sign in to add a comment

Combine disk cleanup routine and Low disk space warning checks to save resources

Project Member Reported by omrilio@chromium.org, Mar 14 2017

Issue description

--- split from  issue 673859  ---
We currently have two tasks with different clock cycles that check for the same thing and trigger different actions
1. We check for disk space below 512MB to show a warning every 1 MINUTE
2. We check for disk space below 512MB* to start disk cleanup every 1 HOUR

Instead, we should have a single check every minute which would trigger the right actions.

(*) the 512MB number is going to change to 1GB in M58
 
Labels: -Pri-3 Pri-2

Comment 2 by cyrusm@chromium.org, Mar 14 2017

Why doesn't disk clean up happen only on an as-needed basis?

Comment 3 by fukino@chromium.org, Mar 14 2017

We check the space periodically because monitoring all changes on the file system has performance overhead.
In addition to the performance overhead, an app could check for disk space available and decide that there isn't enough with it's own internal parameter without us actually being able to detect that as no file system actions are taken.

Comment 5 by jayhlee@google.com, Aug 8 2017

Cc: jayhlee@google.com
Here are my 2 cents, related to another issue.
https://bugs.chromium.org/p/chromium/issues/detail?id=701293#c11

Comment 7 by loyso@chromium.org, Mar 7 2018

Labels: -Type-Bug CrOSFilesFeature-LowStorage Type-Feature
Agreed that disk clean up should happen only on an as-needed basis. (Think of: on-demand garbage collection)

omrilio@ or fukino@ - ping? Any decisions/updates?
Cc: weifangsun@chromium.org
Owner: loyso@chromium.org

Comment 9 by loyso@chromium.org, Mar 28 2018

Components: Platform>Apps>FileManager
Labels: Hotlist-Enterprise

Comment 11 by loyso@google.com, Apr 12 2018

Status: Started (was: Assigned)
Project Member

Comment 12 by bugdroid1@chromium.org, Apr 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/7e8c637f03bb08c7ee187f643b26a17e9a5dddd8

commit 7e8c637f03bb08c7ee187f643b26a17e9a5dddd8
Author: Alexey Baskakov <loyso@chromium.org>
Date: Wed Apr 18 09:08:06 2018

cryptohome: Combine disk cleanup routine and Low disk space warning checks

Previously, Cryptohome checked AmountOfFreeDiskSpace to show a LowDiskSpace
warning every 1 minute. Independently, the disk cleanup routine was called
on a hourly basis. As a result, a user was spammed with low disk space
notifications for up to 1 hour without any cleanup actions from the OS.

This CL combines those two callbacks. We trigger heavy cleanups on minutely
basis, if needed. We shouldn't repeat cleanups on every minute if the disk space
stays below the threshold. We request an ahead-of-schedule cleanup, basically.

Related change: UpdateCurrentUserActivityTimestamp must be called every
24 hours. But the code used a static counter variable. Now it is an explicit
function with a dedicated timestamp.

BUG= chromium:701290 
TEST=Ran all the Cryptohome unit tests, logged callbacks on the dev chromebook.

Change-Id: Idf681dc6be393dd124dc553cf834285562c15aa8
Reviewed-on: https://chromium-review.googlesource.com/1013884
Commit-Ready: Alexey Baskakov <loyso@chromium.org>
Tested-by: Alexey Baskakov <loyso@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>

[modify] https://crrev.com/7e8c637f03bb08c7ee187f643b26a17e9a5dddd8/cryptohome/service.h
[modify] https://crrev.com/7e8c637f03bb08c7ee187f643b26a17e9a5dddd8/cryptohome/service.cc
[modify] https://crrev.com/7e8c637f03bb08c7ee187f643b26a17e9a5dddd8/cryptohome/service_unittest.cc

Comment 13 by loyso@chromium.org, Apr 19 2018

Status: Fixed (was: Started)
Labels: M-68

Comment 15 by loyso@chromium.org, Apr 20 2018

Blocking: 701293

Comment 16 by loyso@chromium.org, May 10 2018

How to reproduce:
1) Login as a test user (Alice) and fill its Browsing Data and/or Offline Files by browsing internet or browsing google drive content in FilesApp. The idea is to allocate some data which may be evicted. Make sure you have enough data allocated in Settings->Device->Storage management: say, X mb (X>100MB). Log out.
2) Login as a second user (Bob). Create a low disk space situation: fill up your primary drive until it goes slightly below 2GB threshold. A notification will pop up.
3) Previously, Bob had to wait for 0-60 minutes to get Alice's cache erased.
With this fix, Alice's cache becomes deleted right after "low disk space notification". Check free disk space. It should be higher than 2GB threshold (old disk space + X mb, X megabytes freed)
4) Login as Alice. Check that your cache was deleted in Storage Manager.

Status: Verified (was: Fixed)
As verified in M68.0.3425.0 10663.0.0 dev paine, "Device is low on space" warning was seen when disk space availability is less than 1GB and some temporary data such as browsing data were deleted to make space available again.
This is just my opinion, but wouldn't it be beneficial to suppress the "Device is low on space" message if the cleanup routine is successful in freeing up space?  This would mitigate some confusion for the end user.  If the cleanup routine is unable to make >2GB (or whatever threshold) available, THEN display the message?

Comment 19 by loyso@chromium.org, May 12 2018

weifangsun@, ping?
IMHO, 2GB is just a bare minimum to avoid bricking the device.
A user should free more space manually (Downloads/ folder, mostly)
I 100% agree.  Unfortunately,
a) A lot of users simply won't.
b) In a multi-user environment like a school, it is typically not the logged in user who is using up all the space...it is the 90 other user profiles on the device over which the current user has no control or access to be able to fee up the needed space.
A notification message is still useful as the basic cleanup routine frees up some space, but with the goal of just making sure the device is usable.

- Users will always have the ability to manually free up additional space.
- Per Comment #20, agreed that not all users will/have the ability to proactively clean up their disk space. We are currently exploring options to more intelligently handle these use cases.

Comment 22 Deleted

Cc: uekawa@chromium.org bartfab@chromium.org naveenv@chromium.org
Hi folks
We have feedback from a school thats piloting Dru, 
- Space maxed out and the current user was being advised to uninstall some apps to create space, but later the device became unresponsive. Files were not auto-cleared and old profiles were not auto-deleted.

In parallel I tried to reproduce this issue with my test device. I started it on v68, added 12 profiles with heavy files and got space filled down to 5mb, with multiple alerts to uninstall apps to create space (it didn't autodelete profiles) and it actually updated to 70 somehow. 

System diagnostics from both devices : https://drive.google.com/corp/drive/u/0/folders/130DwfLRfxedle3tQnO4Qf1_h0imJgpBU

Need to check
- Any issue with the the eviction logic on Dru
- Root cause of behaviour on both devices

Thanks !
Cc: -weifangsun@chromium.org -naveenv@chromium.org -jayhlee@google.com peletskyi@google.com weifangsun@google.com loyso@google.com risan@google.com slangley@google.com naveenv@google.com
Labels: -Pri-2 Pri-1
This bug is marked as fixed - suggest you create a new one if you think there's ongoing/other issues to investigate. 
Just tested -- logged in as 11 users; by the 11th, it gave me the attached message when it tried to install a 4th Android app. I couldn't copy the screenshot  either, I assume from lack of space, so I had to resort to taking a photo of the screen.

I had thought that the idea was to delete the oldest user on the device rather than simply displaying a message about space.
IMG_5797.JPG
2.7 MB View Download

Sign in to add a comment