Bug 8000

Summary: /tmp full sanity test isn't working
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: coreAssignee: Mariano Lopez <mariano.lopez>
Status: VERIFIED FIXED QA Contact: Bogdan Alexandru Voiculescu <bogdanx.a.voiculescu>
Severity: normal    
Priority: Medium CC: bogdanx.a.voiculescu, meta.mr.watcher, meta.watcher
Version: 1.9   
Target Milestone: 1.9   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2015-07-14 20:49:32 UTC
Tonight's run on the AB appears to have ran out of space in /tmp, but the /tmp-is-full detection didn't trigger:

https://autobuilder.yoctoproject.org/main/builders/nightly-arm64/builds/49/steps/BuildImages/logs/stdio
Comment 1 Ross Burton 2015-07-14 20:52:26 UTC
Looks like writing 1KB isn't enough:

Filesystem                             Size  Used Avail Use% Mounted on
/dev/dm-0                              9.1G  8.6G  4.0K 100% /

We should probably write a block worth of data.  Block size can be fetching using statvfs (stat -f -c %s /tmp) from the shell, python has os.statvfs IIRC)
Comment 2 Ross Burton 2015-07-14 22:06:50 UTC
Better idea - rip the test out and use the disk monitoring support instead.  Totally forgot that existed...

From local.conf:

#
# Disk Space Monitoring during the build
#
# Monitor the disk space during the build. If there is less that 1GB of space or less
# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
# of the build. The reason for this is that running completely out of space can corrupt
# files and damages the build in ways which may not be easily recoverable.
BB_DISKMON_DIRS = "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K"

Adding a pair of entries for /tmp (100mb/10mb?) seems like a sensible solution.
Comment 3 Mariano Lopez 2015-07-15 19:30:13 UTC
Sent patches for review
Comment 5 Bogdan Alexandru Voiculescu 2015-09-09 11:12:06 UTC
verified on master db92bc23880794be77373b0f2d8c26279dcecb84; 

I modified the values here BB_DISKMON_DIRS -  "ABORT,/tmp,2000M,700K" in order to exceed the values on my machine 
(tmpfs                    1.9G  352K  1.9G   1% /tmp); 

Space monitoring detected: 

WARNING: The free inode of /tmp (tmpfs) is running low (479.841K left)
ERROR: Immediately abort since the disk space monitor action is "ABORT"!


WARNING: The free space of /tmp (tmpfs) is running low (1.874GB left)
ERROR: Immediately abort since the disk space monitor action is "ABORT"!