Skip to content

Commit

Permalink
filestore loop shutdown: 1. E_CANCELLED code shouldn't be wrapped int…
Browse files Browse the repository at this point in the history
…o MAKE_FILESTORE_ERROR 2. CompletionQueue should be notified about request cancellation (#1520)

* filestore loop shutdown: 1. E_CANCELLED code shouldn't be wrapped into MAKE_FILESTORE_ERROR 2. CompletionQueue should be notified about request cancellation

* filestore loop shutdown: 1. E_CANCELLED code shouldn't be wrapped into MAKE_FILESTORE_ERROR 2. CompletionQueue should be notified about request cancellation - added missing include

* filestore loop shutdown: 1. E_CANCELLED code shouldn't be wrapped into MAKE_FILESTORE_ERROR 2. CompletionQueue should be notified about request cancellation - added missing include

* filestore loop shutdown: 1. E_CANCELLED code shouldn't be wrapped into MAKE_FILESTORE_ERROR 2. CompletionQueue should be notified about request cancellation - fixed build
  • Loading branch information
qkrorlqr committed Jun 29, 2024
1 parent 3b25ff5 commit 75931a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cloud/filestore/libs/vfs_fuse/fs.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "fs.h"

#include "fs_impl.h"

#include <cloud/filestore/libs/vfs/probes.h>
#include <cloud/storage/core/libs/common/helpers.h>

namespace NCloud::NFileStore::NFuse {

Expand Down Expand Up @@ -360,12 +362,12 @@ void CancelRequest(
req,
static_cast<fuse_cancelation_code>(callContext.CancellationCode));

ui32 flags = 0;
SetProtoFlag(flags, NCloud::NProto::EF_SILENT);
requestStats.RequestCompleted(
log,
callContext,
MakeError(
MAKE_FILESTORE_ERROR(E_CANCELLED),
"Driver is stopping"));
MakeError(E_CANCELLED, "Driver is stopping", flags));

const ui64 now = GetCycleCount();
const auto ts = callContext.CalcRequestTime(now);
Expand Down
4 changes: 4 additions & 0 deletions cloud/filestore/libs/vfs_fuse/fs_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ void TFileSystem::CancelRequest(TCallContextPtr callContext, fuse_req_t req)
*RequestStats,
*callContext,
req);

// notifying CompletionQueue about request completion to decrement inflight
// request counter and unblock the stopping procedure
CompletionQueue->Complete(req, [&] (fuse_req_t) { return 0; });
}

} // namespace NCloud::NFileStore::NFuse

0 comments on commit 75931a8

Please sign in to comment.