0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-01 16:28:19 +02:00

ircd::db: Add some exception handlers on these envs.

This commit is contained in:
Jason Volk 2018-08-19 01:14:54 -07:00
parent b5c2270e8c
commit b8936261b5

View file

@ -2921,7 +2921,7 @@ noexcept
rocksdb::Status
ircd::db::database::env::random_access_file::Prefetch(uint64_t offset,
size_t length)
noexcept
noexcept try
{
#ifdef RB_DEBUG_DB_ENV
log::debug
@ -2934,16 +2934,32 @@ noexcept
};
#endif
fs::prefetch(fd, length, offset);
return Status::OK();
}
catch(const fs::filesystem_error &e)
{
log::error
{
log, "'%s': rfile:%p prefetch offset:%zu length:%zu :%s",
d.name,
this,
offset,
length,
e.what()
};
return Status::InvalidArgument();
}
rocksdb::Status
ircd::db::database::env::random_access_file::Read(uint64_t offset,
size_t length,
Slice *result,
char *scratch)
const noexcept
const noexcept try
{
assert(result);
#ifdef RB_DEBUG_DB_ENV
log::debug
{
@ -2957,7 +2973,6 @@ const noexcept
};
#endif
assert(result);
const mutable_buffer buf
{
scratch, length
@ -2972,6 +2987,22 @@ const noexcept
return Status::OK();
}
catch(const fs::filesystem_error &e)
{
log::error
{
log, "'%s': rfile:%p read:%p offset:%zu length:%zu scratch:%p :%s",
d.name,
this,
result,
offset,
length,
scratch,
e.what()
};
return Status::InvalidArgument();
}
rocksdb::Status
ircd::db::database::env::random_access_file::InvalidateCache(size_t offset,