Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions cloud/filestore/libs/vfs_fuse/handle_ops_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ THandleOpsQueue::EResult THandleOpsQueue::AddCreateRequest(
return THandleOpsQueue::EResult::SerializationError;
}

if (!RequestsToProcess.PushBack(result)) {
auto pushPackResult = RequestsToProcess.PushBack(result);
if (HasError(pushPackResult) || !pushPackResult.GetResult()) {
Stats->IncrementOverflowErrorCount();
return THandleOpsQueue::EResult::QueueOverflow;
}
Expand All @@ -60,7 +61,8 @@ THandleOpsQueue::EResult THandleOpsQueue::AddDestroyRequest(
return THandleOpsQueue::EResult::SerializationError;
}

if (!RequestsToProcess.PushBack(result)) {
auto pushPackResult = RequestsToProcess.PushBack(result);
if (HasError(pushPackResult) || !pushPackResult.GetResult()) {
Stats->IncrementOverflowErrorCount();
return THandleOpsQueue::EResult::QueueOverflow;
}
Expand All @@ -71,7 +73,13 @@ THandleOpsQueue::EResult THandleOpsQueue::AddDestroyRequest(

std::optional<NProto::TQueueEntry> THandleOpsQueue::Front()
{
const auto req = RequestsToProcess.Front();
const auto frontResult = RequestsToProcess.Front();
if (HasError(frontResult)) {
Stats->IncrementParseErrorCount();
return std::nullopt;
}

const auto req = frontResult.GetResult();

NProto::TQueueEntry entry;
if (!entry.ParseFromArray(req.data(), req.size())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,19 @@ class TFileRingBufferStorage: public IPersistentStorage

void Commit() override
{
bool success = Storage.Commit();
Y_ENSURE(success, "Failed to commit allocation");
auto res = Storage.Commit();
Y_ENSURE(
!HasError(res),
"Failed to commit allocation: " << FormatError(res));
Comment on lines +103 to +105

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of exceptions usage?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetCounters();
}

void Free(const void* ptr) override
{
bool success = Storage.Free(ptr);
Y_ENSURE(success, "Failed to free pointer " << ptr);
auto res = Storage.Free(ptr);
Y_ENSURE(
!HasError(res),
"Failed to free pointer " << ptr << ": " << FormatError(res));
SetCounters();
}

Expand Down
Loading
Loading