// get our header
DbCellHeader header;
if (buf.contentSize() < static_cast<mb_size_t>(sizeof(header))) {
- debugs(47, 1, "cache_dir[" << sd->index << "]: " <<
- "truncated swap entry meta data at " << dbOffset);
+ debugs(47, DBG_IMPORTANT, "WARNING: cache_dir[" << sd->index << "]: " <<
+ "Ignoring truncated cache entry meta data at " << dbOffset);
counts.invalid++;
return;
}
memcpy(&header, buf.content(), sizeof(header));
if (!header.sane()) {
- debugs(47, 1, "cache_dir[" << sd->index << "]: " <<
- "malformed rock db cell header at " << dbOffset);
+ debugs(47, DBG_IMPORTANT, "WARNING: cache_dir[" << sd->index << "]: " <<
+ "Ignoring malformed cache entry meta data at " << dbOffset);
counts.invalid++;
return;
}
struct stat swap_sb;
if (::stat(path, &swap_sb) < 0) {
- debugs (47, 1, "Creating Rock db directory: " << path);
+ debugs (47, DBG_IMPORTANT, "Creating Rock db directory: " << path);
#ifdef _SQUID_MSWIN_
const int res = mkdir(path);
#else
const int res = mkdir(path, 0700);
#endif
if (res != 0) {
- debugs(47,0, "Failed to create Rock db dir " << path <<
+ debugs(47, DBG_CRITICAL, "Failed to create Rock db dir " << path <<
": " << xstrerror());
fatal("Rock Store db creation error");
}
io = m->createStrategy();
io->init();
} else {
- debugs(47,1, "Rock store is missing DiskIO module: " << ioModule);
+ debugs(47, DBG_CRITICAL, "FATAL: Rock store is missing DiskIO module: " <<
+ ioModule);
fatal("Rock Store missing a required DiskIO module");
}
void
Rock::SwapDir::ioCompletedNotification()
{
- if (!theFile) {
- debugs(47, 1, HERE << filePath << ": initialization failure or " <<
- "premature close of rock db file");
+ if (!theFile)
fatalf("Rock cache_dir failed to initialize db file: %s", filePath);
- }
- if (theFile->error()) {
- debugs(47, 1, HERE << filePath << ": " << xstrerror());
- fatalf("Rock cache_dir failed to open db file: %s", filePath);
- }
+ if (theFile->error())
+ fatalf("Rock cache_dir at %s failed to open db file: %s", filePath,
+ xstrerror());
- // TODO: lower debugging level
- debugs(47,1, "Rock cache_dir[" << index << "] limits: " <<
+ debugs(47, 2, "Rock cache_dir[" << index << "] limits: " <<
std::setw(12) << maxSize() << " disk bytes and " <<
std::setw(7) << map->entryLimit() << " entries");
// but it should not happen for us
void
Rock::SwapDir::diskFull() {
- debugs(20,1, "Internal ERROR: No space left error with rock cache_dir: " <<
- filePath);
+ debugs(20, DBG_IMPORTANT, "Internal ERROR: No space left with " <<
+ "rock cache_dir: " << filePath);
}
/// purge while full(); it should be sufficient to purge just one
try {
return SquidMain(argc, argv);
} catch (const std::exception &e) {
- debugs(0,0, "dying from an unhandled exception: " << e.what());
+ debugs(1, DBG_CRITICAL, "FATAL: dying from an unhandled exception: " <<
+ e.what());
throw;
} catch (...) {
- debugs(0,0, "dying from an unhandled exception.");
+ debugs(1, DBG_CRITICAL, "FATAL: dying from an unhandled exception.");
throw;
}
return -1; // not reached