diff options
author | ilnurkh <ilnurkh@yandex-team.com> | 2023-10-09 23:39:40 +0300 |
---|---|---|
committer | ilnurkh <ilnurkh@yandex-team.com> | 2023-10-09 23:57:14 +0300 |
commit | e601ca03f859335d57ecff2e5aa6af234b6052ed (patch) | |
tree | de519a847e58a1b3993fcbfe05ff44cc946a3e24 /library/cpp/messagebus/oldmodule/module.cpp | |
parent | bbf2b6878af3854815a2c0ecb07a687071787639 (diff) | |
download | ydb-e601ca03f859335d57ecff2e5aa6af234b6052ed.tar.gz |
Y_VERIFY->Y_ABORT_UNLESS at ^l
https://clubs.at.yandex-team.ru/arcadia/29404
Diffstat (limited to 'library/cpp/messagebus/oldmodule/module.cpp')
-rw-r--r-- | library/cpp/messagebus/oldmodule/module.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/messagebus/oldmodule/module.cpp b/library/cpp/messagebus/oldmodule/module.cpp index 24bd778799..4ec37a4d53 100644 --- a/library/cpp/messagebus/oldmodule/module.cpp +++ b/library/cpp/messagebus/oldmodule/module.cpp @@ -143,14 +143,14 @@ namespace NBus { ~TBusModuleImpl() override { // Shutdown cannot be called from destructor, // because module has virtual methods. - Y_VERIFY(State != RUNNING, "if running, must explicitly call Shutdown() before destructor"); + Y_ABORT_UNLESS(State != RUNNING, "if running, must explicitly call Shutdown() before destructor"); Scheduler.Stop(); while (!Jobs.empty()) { DestroyJob(Jobs.front()); } - Y_VERIFY(JobCount == 0, "state check"); + Y_ABORT_UNLESS(JobCount == 0, "state check"); } void OnMessageReceived(TAutoPtr<TBusMessage> msg, TOnMessageContext&); @@ -336,7 +336,7 @@ namespace NBus { } TNetAddr TBusJob::GetPeerAddrNetAddr() const { - Y_VERIFY(!!OnMessageContext); + Y_ABORT_UNLESS(!!OnMessageContext); return OnMessageContext.GetPeerAddrNetAddr(); } @@ -452,7 +452,7 @@ namespace NBus { } } - Y_VERIFY(!(Pending.size() == 0 && Handler == nullptr && Status == MESSAGE_OK && !ReplySent), + Y_ABORT_UNLESS(!(Pending.size() == 0 && Handler == nullptr && Status == MESSAGE_OK && !ReplySent), "Handler returned NULL without Cancel() or SendReply() for message=%016" PRIx64 " type=%d", Message->GetHeader()->Id, Message->GetHeader()->Type); @@ -542,7 +542,7 @@ namespace NBus { void TBusJob::SendReply(TBusMessageAutoPtr reply) { CheckThreadCurrentJob(); - Y_VERIFY(!ReplySent, "cannot call SendReply twice"); + Y_ABORT_UNLESS(!ReplySent, "cannot call SendReply twice"); ReplySent = true; if (!OnMessageContext) return; @@ -581,8 +581,8 @@ namespace NBus { void TBusJob::Sleep(int milliSeconds) { CheckThreadCurrentJob(); - Y_VERIFY(Pending.empty(), "sleep is not allowed when there are pending job"); - Y_VERIFY(SleepUntil == 0, "must not override sleep"); + Y_ABORT_UNLESS(Pending.empty(), "sleep is not allowed when there are pending job"); + Y_ABORT_UNLESS(SleepUntil == 0, "must not override sleep"); SleepUntil = Now() + milliSeconds; } @@ -665,8 +665,8 @@ namespace NBus { } bool TBusModule::StartInput() { - Y_VERIFY(Impl->State == TBusModuleImpl::CREATED, "state check"); - Y_VERIFY(!!Impl->Queue, "state check"); + Y_ABORT_UNLESS(Impl->State == TBusModuleImpl::CREATED, "state check"); + Y_ABORT_UNLESS(!!Impl->Queue, "state check"); Impl->State = TBusModuleImpl::RUNNING; Y_ASSERT(!Impl->ExternalSession); @@ -774,7 +774,7 @@ void TBusModuleImpl::DestroyJob(TJobRunner* job) { { TWhatThreadDoesAcquireGuard<TMutex> G(Lock, "modules: acquiring lock for DestroyJob"); int jobCount = AtomicDecrement(JobCount); - Y_VERIFY(jobCount >= 0, "decremented too much"); + Y_ABORT_UNLESS(jobCount >= 0, "decremented too much"); Jobs.erase(job->JobStorageIterator); if (AtomicGet(State) == STOPPED) { @@ -789,7 +789,7 @@ void TBusModuleImpl::DestroyJob(TJobRunner* job) { void TBusModuleImpl::OnMessageReceived(TAutoPtr<TBusMessage> msg0, TOnMessageContext& context) { TBusMessage* msg = !!msg0 ? msg0.Get() : context.GetMessage(); - Y_VERIFY(!!msg); + Y_ABORT_UNLESS(!!msg); THolder<TJobRunner> jobRunner(new TJobRunner(Module->CreateJobInstance(msg))); jobRunner->Job->MessageHolder.Reset(msg0.Release()); @@ -834,8 +834,8 @@ void TBusModuleImpl::Shutdown() { } EMessageStatus TBusModule::StartJob(TAutoPtr<TBusMessage> message) { - Y_VERIFY(Impl->State == TBusModuleImpl::RUNNING); - Y_VERIFY(!!Impl->Queue); + Y_ABORT_UNLESS(Impl->State == TBusModuleImpl::RUNNING); + Y_ABORT_UNLESS(!!Impl->Queue); if ((unsigned)AtomicGet(Impl->JobCount) >= Impl->ModuleConfig.StarterMaxInFlight) { return MESSAGE_BUSY; |