[Box Backup-dev] Odd error with StoreInfoFile (was: COMMIT r547 - box/trunk/bin/bbackupd)
Ben Summers
boxbackup-dev at fluffy.co.uk
Sun Mar 19 10:20:50 GMT 2006
I've been using 0.10 on Mac OS X, using the StoreInfoFile stuff and
starting it using launchd as I log on. It gets shutdown when I switch
the computer off every night, and occasionally the computer is put to
sleep for a while.
Yesterday it decided to go into a loop, giving me 16Gb of log
messages and a full disc as Mac OS X does not handle log files
terribly well, it seems:
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the
StoreObjectInfoFile, backup cannot continue safely.
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the old store
object info file '/Users/ben/boxbackup/backup-data/bbackupd.state':
No such file or directory
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the old store
object info file '/Users/ben/boxbackup/backup-data/bbackupd.state':
No such file or directory
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the old store
object info file '/Users/ben/boxbackup/backup-data/bbackupd.state':
No such file or directory
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the
StoreObjectInfoFile, backup cannot continue safely.
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the old store
object info file '/Users/ben/boxbackup/backup-data/bbackupd.state':
No such file or directory
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the old store
object info file '/Users/ben/boxbackup/backup-data/bbackupd.state':
No such file or directory
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the
StoreObjectInfoFile, backup cannot continue safely.
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the
StoreObjectInfoFile, backup cannot continue safely.
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the
StoreObjectInfoFile, backup cannot continue safely.
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the old store
object info file '/Users/ben/boxbackup/backup-data/bbackupd.state':
No such file or directory
Mar 18 14:33:51 white bbackupd[197]: Failed to delete the old store
object info file '/Users/ben/boxbackup/backup-data/bbackupd.state':
No such file or directory
I believe this problem survived a shutdown and restart. The logs show
it for the morning, and then again in the evening.
I am not sure quite what would have caused this, as I have not yet
delved into the code deeply enough. However, I have just committed a
bit of code to make the failure less catastrophic.
I am mildly annoyed with myself for missing that in the review. I
think this stems from reviewing by reading diffs, which loses most of
the context. A lesson for the future!
Ben
On 19 Mar 2006, at 10:08, subversion at fluffy.co.uk wrote:
> Author: ben
> Date: 2006-03-19 10:08:56 +0000 (Sun, 19 Mar 2006)
> New Revision: 547
>
> Modified:
> box/trunk/bin/bbackupd/BackupDaemon.cpp
> Log:
> Prevent runaway behaviour when the StoreObjectInfo file doesn't
> exist when it's expected to exist. Not a fix to the underlying
> problem.
>
> Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp
> ===================================================================
> --- box/trunk/bin/bbackupd/BackupDaemon.cpp 2006-03-14 06:08:20 UTC
> (rev 546)
> +++ box/trunk/bin/bbackupd/BackupDaemon.cpp 2006-03-19 10:08:56 UTC
> (rev 547)
> @@ -616,6 +616,9 @@
> ::syslog(LOG_ERR, "Failed to delete the "
> "StoreObjectInfoFile, backup cannot "
> "continue safely.");
> + // prevent runaway process where the logs fill up -- without this
> + // the log message will be emitted in a tight loop.
> + ::sleep(60);
> continue;
> }
>
> @@ -2417,14 +2420,25 @@
> return false;
> }
>
> - std::string StoreObjectInfoFile =
> - GetConfiguration().GetKeyValue("StoreObjectInfoFile");
> + std::string storeObjectInfoFile(GetConfiguration().GetKeyValue
> ("StoreObjectInfoFile"));
>
> - if (::unlink(StoreObjectInfoFile.c_str()) != 0)
> + // Check to see if the file exists
> + if(!FileExists(storeObjectInfoFile.c_str()))
> {
> + // File doesn't exist -- so can't be deleted. But something
> isn't quite right, so log a message
> + ::syslog(LOG_ERR, "Expected to be able to delete "
> + "store object info file '%s', but the file did not exist.",
> + storeObjectInfoFile.c_str());
> + // Return true to stop things going around in a loop
> + return true;
> + }
> +
> + // Actually delete it
> + if(::unlink(storeObjectInfoFile.c_str()) != 0)
> + {
> ::syslog(LOG_ERR, "Failed to delete the old "
> "store object info file '%s': %s",
> - StoreObjectInfoFile.c_str(), strerror(errno));
> + storeObjectInfoFile.c_str(), strerror(errno));
> return false;
> }
>
>
> _______________________________________________
> Boxbackup-dev mailing list
> Boxbackup-dev at fluffy.co.uk
> http://lists.warhead.org.uk/mailman/listinfo/boxbackup-dev
More information about the Boxbackup-dev
mailing list