0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::db: Update env exception handlers to propagate to rocksdb.

This commit is contained in:
Jason Volk 2018-08-23 04:20:16 -07:00
parent f630c28439
commit 29d4ec71d5

View file

@ -2939,7 +2939,7 @@ noexcept try
offset += length; offset += length;
return Status::OK(); return Status::OK();
} }
catch(const std::exception &e) catch(const fs::error &e)
{ {
log::error log::error
{ {
@ -2953,7 +2953,23 @@ catch(const std::exception &e)
e.what() e.what()
}; };
return Status::InvalidArgument(); return error_to_status{e};
}
catch(const std::exception &e)
{
log::critical
{
log, "'%s': seqfile:%p read:%p offset:%zu length:%zu scratch:%p :%s",
d.name,
this,
result,
offset,
length,
scratch,
e.what()
};
return error_to_status{e};
} }
rocksdb::Status rocksdb::Status
@ -2992,7 +3008,7 @@ noexcept try
*result = slice(read); *result = slice(read);
return Status::OK(); return Status::OK();
} }
catch(const std::exception &e) catch(const fs::error &e)
{ {
log::error log::error
{ {
@ -3006,7 +3022,23 @@ catch(const std::exception &e)
e.what() e.what()
}; };
return Status::InvalidArgument(); return error_to_status{e};
}
catch(const std::exception &e)
{
log::critical
{
log, "'%s': seqfile:%p positioned read:%p offset:%zu length:%zu scratch:%p :%s",
d.name,
this,
result,
offset,
length,
scratch,
e.what()
};
return error_to_status{e};
} }
rocksdb::Status rocksdb::Status
@ -3138,9 +3170,13 @@ noexcept try
fs::prefetch(fd, length, offset); fs::prefetch(fd, length, offset);
return Status::OK(); return Status::OK();
} }
catch(const fs::filesystem_error &e) catch(const fs::error &e)
{ {
log::error return error_to_status{e};
}
catch(const std::exception &e)
{
log::critical
{ {
log, "'%s': rfile:%p prefetch offset:%zu length:%zu :%s", log, "'%s': rfile:%p prefetch offset:%zu length:%zu :%s",
d.name, d.name,
@ -3150,7 +3186,7 @@ catch(const fs::filesystem_error &e)
e.what() e.what()
}; };
return Status::InvalidArgument(); return error_to_status{e};
} }
rocksdb::Status rocksdb::Status
@ -3190,7 +3226,7 @@ const noexcept try
return Status::OK(); return Status::OK();
} }
catch(const std::exception &e) catch(const fs::error &e)
{ {
log::error log::error
{ {
@ -3204,7 +3240,23 @@ catch(const std::exception &e)
e.what() e.what()
}; };
return Status::InvalidArgument(); return error_to_status{e};
}
catch(const std::exception &e)
{
log::critical
{
log, "'%s': rfile:%p read:%p offset:%zu length:%zu scratch:%p :%s",
d.name,
this,
result,
offset,
length,
scratch,
e.what()
};
return error_to_status{e};
} }
rocksdb::Status rocksdb::Status
@ -3231,7 +3283,7 @@ noexcept
size_t size_t
ircd::db::database::env::random_access_file::GetUniqueId(char* id, ircd::db::database::env::random_access_file::GetUniqueId(char* id,
size_t max_size) size_t max_size)
const noexcept const noexcept try
{ {
const ctx::uninterruptible::nothrow ui; const ctx::uninterruptible::nothrow ui;
@ -3253,6 +3305,20 @@ const noexcept
return size(fs::uuid(fd, buf)); return size(fs::uuid(fd, buf));
} }
catch(const std::exception &e)
{
log::critical
{
log, "'%s': rfile:%p GetUniqueId id:%p max_size:%zu :%s",
d.name,
this,
id,
max_size,
e.what()
};
return 0;
}
void void
ircd::db::database::env::random_access_file::Hint(AccessPattern pattern) ircd::db::database::env::random_access_file::Hint(AccessPattern pattern)