diff options
author | azevaykin <azevaykin@yandex-team.com> | 2023-06-02 13:57:11 +0300 |
---|---|---|
committer | azevaykin <azevaykin@yandex-team.com> | 2023-06-02 13:57:11 +0300 |
commit | 2db4f2f2bb216d58c151f26bba0a849c79beadc5 (patch) | |
tree | d24ab84bfe6fd48063454edb76e9eb6abcae971c | |
parent | 267e363c49116d6b7b64c43012b622cd17c76542 (diff) | |
download | ydb-2db4f2f2bb216d58c151f26bba0a849c79beadc5.tar.gz |
Graceful stop on "session close"
-rw-r--r-- | ydb/public/lib/ydb_cli/commands/topic_workload/topic_workload_writer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ydb/public/lib/ydb_cli/commands/topic_workload/topic_workload_writer.cpp b/ydb/public/lib/ydb_cli/commands/topic_workload/topic_workload_writer.cpp index c75b437dfc..3cf13077c4 100644 --- a/ydb/public/lib/ydb_cli/commands/topic_workload/topic_workload_writer.cpp +++ b/ydb/public/lib/ydb_cli/commands/topic_workload/topic_workload_writer.cpp @@ -109,7 +109,7 @@ void TTopicWorkloadWriterWorker::Process() { } else WRITE_LOG(Params.Log, ELogPriority::TLOG_DEBUG, TStringBuilder() << "No WaitEvent"); - while (true) { + while (!*Params.ErrorFlag) { auto events = WriteSession->GetEvents(false); WRITE_LOG(Params.Log, ELogPriority::TLOG_DEBUG, TStringBuilder() << "Got " << events.size() << " events."); @@ -205,9 +205,9 @@ bool TTopicWorkloadWriterWorker::ProcessReadyToAcceptEvent( bool TTopicWorkloadWriterWorker::ProcessSessionClosedEvent( const NYdb::NTopic::TSessionClosedEvent& event) { - WRITE_LOG(Params.Log, ELogPriority::TLOG_INFO, TStringBuilder() << "Got close event: " << event.DebugString()); + WRITE_LOG(Params.Log, ELogPriority::TLOG_EMERG, TStringBuilder() << "Got close event: " << event.DebugString()); //! Session is closed, stop any work with it. - Y_FAIL("session closed"); + *Params.ErrorFlag = 1; return false; } |