- Show warning in log if writing cached data to database is slow
- Try database query for up to 5 seconds when database is busy or locked
instead of giving up immediately
+ - Continue daemon process execution with data caching if database writes
+ fail due to disk being full
2.2 / 28-Apr-2018
printe(PT_Error);
errorexitdaemon(s, 1);
} else {
- s->dbretrycount++;
- if (s->dbretrycount >= DBRETRYLIMIT) {
- snprintf(errorstring, 1024, "Database error retry limit %d reached, exiting.", DBRETRYLIMIT);
+ if (db_isdiskfull(db_errcode)) {
+ snprintf(errorstring, 1024, "Disk is full, continuing with data caching.");
printe(PT_Error);
- errorexitdaemon(s, 1);
+ } else {
+ s->dbretrycount++;
+ if (s->dbretrycount >= DBRETRYLIMIT) {
+ snprintf(errorstring, 1024, "Database error retry limit %d reached, exiting.", DBRETRYLIMIT);
+ printe(PT_Error);
+ errorexitdaemon(s, 1);
+ }
}
}
}
}
}
+int db_isdiskfull(int errcode)
+{
+ if (errcode == SQLITE_FULL) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
#if HAVE_DECL_SQLITE_CHECKPOINT_RESTART
void db_walcheckpoint(void)
{
int db_committransaction(void);
int db_rollbacktransaction(void);
int db_iserrcodefatal(int errcode);
+int db_isdiskfull(int errcode);
#if HAVE_DECL_SQLITE_CHECKPOINT_RESTART
void db_walcheckpoint(void);
#endif