Skip to content

Commit

Permalink
filestore-client: fixed crashes on DestroySession error, fixed ls nod…
Browse files Browse the repository at this point in the history
…e type output (#2168)

* filestore-client: fixed crashes on DestroySession error, fixed ls node type output

* filestore-client: fixed crashes on DestroySession error, fixed ls node type output - cleanup
  • Loading branch information
qkrorlqr committed Sep 29, 2024
1 parent ba37800 commit 78fb98b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cloud/filestore/apps/client/lib/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class TCommand
return Opts;
}

TLog& AccessLog()
{
return Log;
}

protected:
virtual void Init();

Expand Down Expand Up @@ -177,16 +182,22 @@ class TFileStoreCommand
class TSessionGuard final
{
TFileStoreCommand& FileStoreCmd;
TLog& Log;

public:
explicit TSessionGuard(TFileStoreCommand& fileStoreCmd)
: FileStoreCmd(fileStoreCmd)
, Log(FileStoreCmd.AccessLog())
{
}

~TSessionGuard()
{
FileStoreCmd.DestroySession();
try {
FileStoreCmd.DestroySession();
} catch (...) {
STORAGE_ERROR("~TSessionGuard: " << CurrentExceptionMessage());
}
}
};

Expand Down
2 changes: 2 additions & 0 deletions cloud/filestore/apps/client/lib/ls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ TString NodeTypeToString(NProto::ENodeType nodeType)
return "l";
case NProto::E_SOCK_NODE:
return "s";
case NProto::E_SYMLINK_NODE:
return "L";
default:
ythrow yexception() << "must be unreachable";
}
Expand Down

0 comments on commit 78fb98b

Please sign in to comment.