Description
The embedded LFS object store in Bitbucket Server can (and by default does) enforce a minimum free disk space requirement, so as to prevent completely filling a filesystem with LFS objects. This is described in the section "Limiting Disk Space Usage" here.
To determine the amount of free disk space on the filesystem that hosts LFS objects Bitbucket Server uses FileStore.getUsableSpace(). If this fails with an IOException two things are logged:
1) An error that says "Failed to retrieve free space for filesystem" (including the full exception stack trace); and
2) An error that says "Insufficient free space in store" (also including a stack trace)
We should only log 1 in the case the call to getUsableSpace() fails; logging 2 is confusing.
Part of the reason 2 is logged is because in the case the system fails to determine the available free disk space, we treat it the same as if the disk is full, the upload is failed to avoid exceeding the free disk space threshold.