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/actors/core | |
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/actors/core')
36 files changed, 123 insertions, 123 deletions
diff --git a/library/cpp/actors/core/actor.cpp b/library/cpp/actors/core/actor.cpp index 73edd82067..4f7d4c1493 100644 --- a/library/cpp/actors/core/actor.cpp +++ b/library/cpp/actors/core/actor.cpp @@ -18,7 +18,7 @@ namespace NActors { ui64 count = value >> T::TimestampBits; count += Increment; - Y_VERIFY((count & ~T::CountMask) == 0); + Y_ABORT_UNLESS((count & ~T::CountMask) == 0); ui64 timestamp = value; if (Increment == 1 && count == 1) { @@ -53,7 +53,7 @@ namespace NActors { used += (static_cast<ui64>(time) - value) & TimestampMask; } - Y_VERIFY(LastUsageTimestamp <= time); + Y_ABORT_UNLESS(LastUsageTimestamp <= time); ui64 passed = time - LastUsageTimestamp; LastUsageTimestamp = time; @@ -188,7 +188,7 @@ namespace NActors { void IActor::Die(const TActorContext& ctx) { if (ctx.SelfID) - Y_VERIFY(ctx.SelfID == SelfActorId); + Y_ABORT_UNLESS(ctx.SelfID == SelfActorId); PassAway(); } @@ -206,7 +206,7 @@ namespace NActors { } void TActorVirtualBehaviour::Receive(IActor* actor, std::unique_ptr<IEventHandle> ev) { - Y_VERIFY(!!ev && ev->GetBase()); + Y_ABORT_UNLESS(!!ev && ev->GetBase()); ev->GetBase()->Execute(actor, std::move(ev)); } diff --git a/library/cpp/actors/core/actor.h b/library/cpp/actors/core/actor.h index 3f9a5751a4..d151425680 100644 --- a/library/cpp/actors/core/actor.h +++ b/library/cpp/actors/core/actor.h @@ -475,7 +475,7 @@ namespace NActors { } ~TRecurseContext() { - Y_VERIFY(TlsActivationContext == this, "TlsActivationContext mismatch; probably InvokeOtherActor was invoked from a coroutine"); + Y_ABORT_UNLESS(TlsActivationContext == this, "TlsActivationContext mismatch; probably InvokeOtherActor was invoked from a coroutine"); TlsActivationContext = Prev; } } context(actor.SelfId()); @@ -902,7 +902,7 @@ namespace NActors { template <ESendingType SendingType> TActorId IActor::Register(IActor* actor, TMailboxType::EType mailboxType, ui32 poolId) const noexcept { - Y_VERIFY(actor); + Y_ABORT_UNLESS(actor); return TlsActivationContext->ExecutorThread.RegisterActor<SendingType>(actor, mailboxType, poolId, SelfActorId); } @@ -910,8 +910,8 @@ namespace NActors { template <ESendingType SendingType> TActorId TActorSystem::Register(IActor* actor, TMailboxType::EType mailboxType, ui32 executorPool, ui64 revolvingCounter, const TActorId& parentId) { - Y_VERIFY(actor); - Y_VERIFY(executorPool < ExecutorPoolCount, "executorPool# %" PRIu32 ", ExecutorPoolCount# %" PRIu32, + Y_ABORT_UNLESS(actor); + Y_ABORT_UNLESS(executorPool < ExecutorPoolCount, "executorPool# %" PRIu32 ", ExecutorPoolCount# %" PRIu32, (ui32)executorPool, (ui32)ExecutorPoolCount); if constexpr (SendingType == ESendingType::Common) { return CpuManager->GetExecutorPool(executorPool)->Register(actor, mailboxType, revolvingCounter, parentId); diff --git a/library/cpp/actors/core/actor_bootstrapped.h b/library/cpp/actors/core/actor_bootstrapped.h index 5d3d381d6e..70a6163bc5 100644 --- a/library/cpp/actors/core/actor_bootstrapped.h +++ b/library/cpp/actors/core/actor_bootstrapped.h @@ -16,7 +16,7 @@ namespace NActors { } STFUNC(StateBootstrap) { - Y_VERIFY(ev->GetTypeRewrite() == TEvents::TSystem::Bootstrap, "Unexpected bootstrap message"); + Y_ABORT_UNLESS(ev->GetTypeRewrite() == TEvents::TSystem::Bootstrap, "Unexpected bootstrap message"); using T = decltype(&TDerived::Bootstrap); TDerived& self = static_cast<TDerived&>(*this); if constexpr (std::is_invocable_v<T, TDerived, const TActorContext&>) { diff --git a/library/cpp/actors/core/actor_coroutine.cpp b/library/cpp/actors/core/actor_coroutine.cpp index 8dde637bf2..9b0c81fa26 100644 --- a/library/cpp/actors/core/actor_coroutine.cpp +++ b/library/cpp/actors/core/actor_coroutine.cpp @@ -57,7 +57,7 @@ namespace NActors { } // ensure we have no unprocessed event and return back to actor system to receive one - Y_VERIFY(!Finished); + Y_ABORT_UNLESS(!Finished); // obtain pending event and ensure we've got one while (THolder<IEventHandle> event = ReturnToActorSystem()) { @@ -72,7 +72,7 @@ namespace NActors { bool TActorCoroImpl::ProcessEvent(THolder<IEventHandle> ev) { if (!SelfActorId) { // process bootstrap message, extract actor ids - Y_VERIFY(ev->GetTypeRewrite() == TEvents::TSystem::Bootstrap); + Y_ABORT_UNLESS(ev->GetTypeRewrite() == TEvents::TSystem::Bootstrap); SelfActorId = ev->Recipient; ParentActorId = ev->Sender; ev.Reset(); @@ -97,7 +97,7 @@ namespace NActors { void TActorCoroImpl::Resume(THolder<IEventHandle> ev) { BeforeResume(); - Y_VERIFY(!PendingEvent); + Y_ABORT_UNLESS(!PendingEvent); PendingEvent.Swap(ev); #if CORO_THROUGH_THREADS @@ -106,7 +106,7 @@ namespace NActors { OutEvent.Wait(); #else // save caller context for a later return - Y_VERIFY(!ActorSystemContext); + Y_ABORT_UNLESS(!ActorSystemContext); TExceptionSafeContext actorSystemContext; ActorSystemContext = &actorSystemContext; @@ -114,7 +114,7 @@ namespace NActors { ActorSystemContext->SwitchTo(&FiberContext); #endif - Y_VERIFY(!PendingEvent); + Y_ABORT_UNLESS(!PendingEvent); } void TActorCoroImpl::DoRun() { @@ -150,7 +150,7 @@ namespace NActors { } #else TExceptionSafeContext* returnContext = std::exchange(ActorSystemContext, nullptr); - Y_VERIFY(returnContext); + Y_ABORT_UNLESS(returnContext); if (StoreTlsState) { StoreTlsState(this); } @@ -165,7 +165,7 @@ namespace NActors { } else { // we have returned from the actor system and it kindly asks us to terminate the coroutine as it is being // stopped - Y_VERIFY(InvokedFromDtor); + Y_ABORT_UNLESS(InvokedFromDtor); throw TDtorException(); } } diff --git a/library/cpp/actors/core/actor_virtual.h b/library/cpp/actors/core/actor_virtual.h index c9c34c4729..9b02660c65 100644 --- a/library/cpp/actors/core/actor_virtual.h +++ b/library/cpp/actors/core/actor_virtual.h @@ -21,7 +21,7 @@ public: { Y_VERIFY_DEBUG(dynamic_cast<TEvent*>(Handle->GetBase())); Event = static_cast<TEvent*>(Handle->GetBase()); - Y_VERIFY(Event); + Y_ABORT_UNLESS(Event); } }; diff --git a/library/cpp/actors/core/actorid.h b/library/cpp/actors/core/actorid.h index a9cac589b2..df1cac1c4e 100644 --- a/library/cpp/actors/core/actorid.h +++ b/library/cpp/actors/core/actorid.h @@ -50,7 +50,7 @@ namespace NActors { } explicit TActorId(ui32 nodeId, const TStringBuf& x) noexcept { - Y_VERIFY(x.size() <= MaxServiceIDLength, "service id is too long"); + Y_ABORT_UNLESS(x.size() <= MaxServiceIDLength, "service id is too long"); Raw.N.LocalId = 0; Raw.N.Hint = 0; Raw.N.NodeId = nodeId | ServiceMask; diff --git a/library/cpp/actors/core/actorsystem.cpp b/library/cpp/actors/core/actorsystem.cpp index 9207e3407e..b73c545134 100644 --- a/library/cpp/actors/core/actorsystem.cpp +++ b/library/cpp/actors/core/actorsystem.cpp @@ -106,7 +106,7 @@ namespace NActors { if (recpNodeId != NodeId && recpNodeId != 0) { // if recipient is not local one - rewrite with forward instruction Y_VERIFY_DEBUG(!ev->HasEvent() || ev->GetBase()->IsSerializable()); - Y_VERIFY(ev->Recipient == recipient, + Y_ABORT_UNLESS(ev->Recipient == recipient, "Event rewrite from %s to %s would be lost via interconnect", ev->Recipient.ToString().c_str(), recipient.ToString().c_str()); @@ -255,7 +255,7 @@ namespace NActors { } void TActorSystem::Start() { - Y_VERIFY(StartExecuted == false); + Y_ABORT_UNLESS(StartExecuted == false); StartExecuted = true; ScheduleQueue.Reset(new NSchedulerQueue::TQueueType()); @@ -273,7 +273,7 @@ namespace NActors { TActorSetupCmd& x = setup.ProxyActors[i]; if (x.Actor) { Interconnect[i] = Register(x.Actor.release(), x.MailboxType, x.PoolId, i); - Y_VERIFY(!!Interconnect[i]); + Y_ABORT_UNLESS(!!Interconnect[i]); } } ProxyWrapperFactory = std::move(SystemSetup->Interconnect.ProxyWrapperFactory); @@ -284,7 +284,7 @@ namespace NActors { for (ui32 i = 0, e = (ui32)SystemSetup->LocalServices.size(); i != e; ++i) { std::pair<TActorId, TActorSetupCmd>& x = SystemSetup->LocalServices[i]; const TActorId xid = Register(x.second.Actor.release(), x.second.MailboxType, x.second.PoolId, i); - Y_VERIFY(!!xid); + Y_ABORT_UNLESS(!!xid); if (!!x.first) RegisterLocalService(x.first, xid); } diff --git a/library/cpp/actors/core/actorsystem.h b/library/cpp/actors/core/actorsystem.h index 64a8e827d2..1b18abc787 100644 --- a/library/cpp/actors/core/actorsystem.h +++ b/library/cpp/actors/core/actorsystem.h @@ -117,7 +117,7 @@ namespace NActors { ui32 GetThreads(ui32 poolId) const { auto result = GetThreadsOptional(poolId); - Y_VERIFY(result, "undefined pool id: %" PRIu32, (ui32)poolId); + Y_ABORT_UNLESS(result, "undefined pool id: %" PRIu32, (ui32)poolId); return *result; } diff --git a/library/cpp/actors/core/balancer.cpp b/library/cpp/actors/core/balancer.cpp index d82701bbfb..e09c834543 100644 --- a/library/cpp/actors/core/balancer.cpp +++ b/library/cpp/actors/core/balancer.cpp @@ -51,11 +51,11 @@ namespace NActors { ui64 idle = std::clamp<i64>(1024 - cpuIdle * 512, 0, 1023); ui64 scale = std::clamp<i64>(1024 - scaleFactor * 32, 0, 1023); - Y_VERIFY(ui64(load) < (1ull << 2ull)); - Y_VERIFY(ui64(priority) < (1ull << 8ull)); - Y_VERIFY(ui64(scale) < (1ull << 10ull)); - Y_VERIFY(ui64(idle) < (1ull << 10ull)); - Y_VERIFY(ui64(poolId) < (1ull << 6ull)); + Y_ABORT_UNLESS(ui64(load) < (1ull << 2ull)); + Y_ABORT_UNLESS(ui64(priority) < (1ull << 8ull)); + Y_ABORT_UNLESS(ui64(scale) < (1ull << 10ull)); + Y_ABORT_UNLESS(ui64(idle) < (1ull << 10ull)); + Y_ABORT_UNLESS(ui64(poolId) < (1ull << 6ull)); static_assert(ui64(MaxPools) <= (1ull << 6ull)); @@ -135,7 +135,7 @@ namespace NActors { Config.MinCpus = std::clamp<ui32>(Config.MinCpus, 1, Config.Cpus); Config.MaxCpus = Max<ui32>(Config.MaxCpus, Config.Cpus); } else { - Y_VERIFY(Config.Cpus == 0, + Y_ABORT_UNLESS(Config.Cpus == 0, "Unexpected negative Config.Cpus# %" PRIi64, (i64)Config.Cpus); Config.MinCpus = 0; @@ -205,7 +205,7 @@ namespace NActors { } void TBalancer::SetPoolStats(TPoolId pool, const TBalancerStats& stats) { - Y_VERIFY(pool < MaxPools); + Y_ABORT_UNLESS(pool < MaxPools); TPool& p = Pools[pool]; p.Prev = p.Next; p.Next = stats; diff --git a/library/cpp/actors/core/benchmark_ut.cpp b/library/cpp/actors/core/benchmark_ut.cpp index 12ef30ecb2..380e983b92 100644 --- a/library/cpp/actors/core/benchmark_ut.cpp +++ b/library/cpp/actors/core/benchmark_ut.cpp @@ -210,8 +210,8 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { : Params(params) , ActiveEventRegistry_(activeEventRegistry) { - Y_VERIFY(!Params.Container.empty()); - Y_VERIFY(Params.Right - Params.Left + 1 <= static_cast<i32>(Params.Container.size()), + Y_ABORT_UNLESS(!Params.Container.empty()); + Y_ABORT_UNLESS(Params.Right - Params.Left + 1 <= static_cast<i32>(Params.Container.size()), "left: %d, right: %d, cont.size: %d", Params.Left, Params.Right, static_cast<i32>(Params.Container.size())); ActiveEventRegistry_.SetActive(this); } @@ -242,7 +242,7 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { switch (ev->GetTypeRewrite()) { hFunc(TEvQuickSort, Handle); default: - Y_VERIFY(false); + Y_ABORT_UNLESS(false); } } @@ -373,7 +373,7 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { BENCH_START(thread); - Y_VERIFY(threadPool.AddAndOwn(THolder(new TQuickSortTask(params, activeThreadRegistry)))); + Y_ABORT_UNLESS(threadPool.AddAndOwn(THolder(new TQuickSortTask(params, activeThreadRegistry)))); UNIT_ASSERT_C(activeThreadRegistry.WaitForAllInactive(60s), "timeout"); threaPoolSortDurationTotal += std::chrono::duration_cast<std::chrono::microseconds>(BENCH_END(thread)); @@ -491,7 +491,7 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { switch (ev->GetTypeRewrite()) { hFunc(TEvKvSendRequests, Handle); default: - Y_VERIFY(false); + Y_ABORT_UNLESS(false); } } @@ -529,7 +529,7 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { switch (ev->GetTypeRewrite()) { hFunc(TEvKvSearch, Handle); default: - Y_VERIFY(false); + Y_ABORT_UNLESS(false); } } @@ -587,7 +587,7 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { } } - Y_VERIFY(keys.size() >= requestsNumber); + Y_ABORT_UNLESS(keys.size() >= requestsNumber); std::random_shuffle(keys.begin(), keys.end()); keys.resize(requestsNumber); @@ -709,7 +709,7 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { BENCH_START(kvSearch); for (auto& key : keysToSearch) { - Y_VERIFY(threadPool.AddAndOwn(THolder(new TKvSearchTask(key, dict)))); + Y_ABORT_UNLESS(threadPool.AddAndOwn(THolder(new TKvSearchTask(key, dict)))); } // CondVar logic gives too much of overhead (2-10 times more than just sleep_for) @@ -897,7 +897,7 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { hFunc(TEvSumSendRequests, HandleRequest); hFunc(TEvSumVectorResult, HandleResult); default: - Y_VERIFY(false); + Y_ABORT_UNLESS(false); } } @@ -974,7 +974,7 @@ Y_UNIT_TEST_SUITE(ActorSystemBenchmark) { switch (ev->GetTypeRewrite()) { hFunc(TEvSumVector, Handle); default: - Y_VERIFY(false); + Y_ABORT_UNLESS(false); } } diff --git a/library/cpp/actors/core/callstack.cpp b/library/cpp/actors/core/callstack.cpp index 9297c1a079..559cc73550 100644 --- a/library/cpp/actors/core/callstack.cpp +++ b/library/cpp/actors/core/callstack.cpp @@ -19,7 +19,7 @@ namespace NActors { void EnableActorCallstack() { if (ActorBackTraceEnableCounter == 0) { - Y_VERIFY(PreviousFormatBackTrace == 0); + Y_ABORT_UNLESS(PreviousFormatBackTrace == 0); PreviousFormatBackTrace = SetFormatBackTraceFn(ActorFormatBackTrace); } @@ -30,7 +30,7 @@ namespace NActors { --ActorBackTraceEnableCounter; if (ActorBackTraceEnableCounter == 0) { - Y_VERIFY(PreviousFormatBackTrace); + Y_ABORT_UNLESS(PreviousFormatBackTrace); SetFormatBackTraceFn(PreviousFormatBackTrace); PreviousFormatBackTrace = 0; } diff --git a/library/cpp/actors/core/config.h b/library/cpp/actors/core/config.h index ab35998241..38aaf77797 100644 --- a/library/cpp/actors/core/config.h +++ b/library/cpp/actors/core/config.h @@ -146,7 +146,7 @@ namespace NActors { ui32 GetThreads(ui32 poolId) const { auto result = GetThreadsOptional(poolId); - Y_VERIFY(result, "undefined pool id: %" PRIu32, (ui32)poolId); + Y_ABORT_UNLESS(result, "undefined pool id: %" PRIu32, (ui32)poolId); return *result; } }; @@ -218,7 +218,7 @@ namespace NActors { TCpuAllocationConfig(const TCpuMask& available, const TCpuManagerConfig& cfg) { for (const TUnitedExecutorPoolConfig& pool : cfg.United) { - Y_VERIFY(pool.PoolId < MaxPools, "wrong PoolId of united executor pool: %s(%d)", + Y_ABORT_UNLESS(pool.PoolId < MaxPools, "wrong PoolId of united executor pool: %s(%d)", pool.PoolName.c_str(), (pool.PoolId)); } ui32 allocated[MaxPools] = {0}; @@ -240,7 +240,7 @@ namespace NActors { } } for (const TUnitedExecutorPoolConfig& pool : cfg.United) { - Y_VERIFY(allocated[pool.PoolId] > 0, "unable to allocate cpu for united executor pool: %s(%d)", + Y_ABORT_UNLESS(allocated[pool.PoolId] > 0, "unable to allocate cpu for united executor pool: %s(%d)", pool.PoolName.c_str(), (pool.PoolId)); } } diff --git a/library/cpp/actors/core/cpu_manager.cpp b/library/cpp/actors/core/cpu_manager.cpp index 3ec6cea5a3..df4ea486e4 100644 --- a/library/cpp/actors/core/cpu_manager.cpp +++ b/library/cpp/actors/core/cpu_manager.cpp @@ -17,7 +17,7 @@ namespace NActors { Executors.Reset(setup->Executors.Release()); for (ui32 excIdx = 0; excIdx != ExecutorPoolCount; ++excIdx) { IExecutorPool* pool = Executors[excIdx].Get(); - Y_VERIFY(dynamic_cast<TUnitedExecutorPool*>(pool) == nullptr, + Y_ABORT_UNLESS(dynamic_cast<TUnitedExecutorPool*>(pool) == nullptr, "united executor pool is prohibited in explicit mode of NActors::TCpuManager"); } } else { @@ -103,7 +103,7 @@ namespace NActors { void TCpuManager::Cleanup() { for (ui32 round = 0, done = 0; done < ExecutorPoolCount; ++round) { - Y_VERIFY(round < 10, "actorsystem cleanup could not be completed in 10 rounds"); + Y_ABORT_UNLESS(round < 10, "actorsystem cleanup could not be completed in 10 rounds"); done = 0; for (ui32 excIdx = 0; excIdx != ExecutorPoolCount; ++excIdx) { if (Executors[excIdx]->Cleanup()) { diff --git a/library/cpp/actors/core/event.h b/library/cpp/actors/core/event.h index 67ab519945..4f6aefc0ee 100644 --- a/library/cpp/actors/core/event.h +++ b/library/cpp/actors/core/event.h @@ -139,8 +139,8 @@ namespace NActors { } static ui32 MakeFlags(ui32 channel, TEventFlags flags) { - Y_VERIFY(channel < (1 << ChannelBits)); - Y_VERIFY(flags < (1 << ChannelShift)); + Y_ABORT_UNLESS(channel < (1 << ChannelBits)); + Y_ABORT_UNLESS(flags < (1 << ChannelShift)); return (flags | (channel << ChannelShift)); } diff --git a/library/cpp/actors/core/event_load.h b/library/cpp/actors/core/event_load.h index 0062ee40db..c776026cc4 100644 --- a/library/cpp/actors/core/event_load.h +++ b/library/cpp/actors/core/event_load.h @@ -93,7 +93,7 @@ namespace NActors { } TRope EraseBack(size_t count) { - Y_VERIFY(count <= Rope.GetSize()); + Y_ABORT_UNLESS(count <= Rope.GetSize()); TRope::TIterator iter = Rope.End(); iter -= count; return Rope.Extract(iter, Rope.End()); diff --git a/library/cpp/actors/core/event_pb.cpp b/library/cpp/actors/core/event_pb.cpp index a2bf14aa02..a72c52efc2 100644 --- a/library/cpp/actors/core/event_pb.cpp +++ b/library/cpp/actors/core/event_pb.cpp @@ -15,7 +15,7 @@ namespace NActors { } void TRopeStream::BackUp(int count) { - Y_VERIFY(count <= TotalByteCount); + Y_ABORT_UNLESS(count <= TotalByteCount); Iter -= count; TotalByteCount -= count; } @@ -39,7 +39,7 @@ namespace NActors { TCoroutineChunkSerializer::~TCoroutineChunkSerializer() { CancelFlag = true; Resume(); - Y_VERIFY(Finished); + Y_ABORT_UNLESS(Finished); } bool TCoroutineChunkSerializer::AllowsAliasing() const { @@ -47,7 +47,7 @@ namespace NActors { } void TCoroutineChunkSerializer::Produce(const void *data, size_t size) { - Y_VERIFY(size <= SizeRemain); + Y_ABORT_UNLESS(size <= SizeRemain); SizeRemain -= size; TotalSerializedDataSize += size; @@ -63,9 +63,9 @@ namespace NActors { } bool TCoroutineChunkSerializer::WriteAliasedRaw(const void* data, int size) { - Y_VERIFY(!CancelFlag); - Y_VERIFY(!AbortFlag); - Y_VERIFY(size >= 0); + Y_ABORT_UNLESS(!CancelFlag); + Y_ABORT_UNLESS(!AbortFlag); + Y_ABORT_UNLESS(size >= 0); while (size) { if (const size_t bytesToAppend = Min<size_t>(size, SizeRemain)) { const void *produce = data; @@ -89,15 +89,15 @@ namespace NActors { } bool TCoroutineChunkSerializer::Next(void** data, int* size) { - Y_VERIFY(!CancelFlag); - Y_VERIFY(!AbortFlag); + Y_ABORT_UNLESS(!CancelFlag); + Y_ABORT_UNLESS(!AbortFlag); if (!SizeRemain) { InnerContext.SwitchTo(BufFeedContext); if (CancelFlag || AbortFlag) { return false; } } - Y_VERIFY(SizeRemain); + Y_ABORT_UNLESS(SizeRemain); *data = BufferPtr; *size = SizeRemain; BufferPtr += SizeRemain; @@ -109,11 +109,11 @@ namespace NActors { if (!count) { return; } - Y_VERIFY(count > 0); - Y_VERIFY(!Chunks.empty()); + Y_ABORT_UNLESS(count > 0); + Y_ABORT_UNLESS(!Chunks.empty()); TChunk& buf = Chunks.back(); - Y_VERIFY((size_t)count <= buf.second); - Y_VERIFY(buf.first + buf.second == BufferPtr, "buf# %p:%zu BufferPtr# %p SizeRemain# %zu NumChunks# %zu", + Y_ABORT_UNLESS((size_t)count <= buf.second); + Y_ABORT_UNLESS(buf.first + buf.second == BufferPtr, "buf# %p:%zu BufferPtr# %p SizeRemain# %zu NumChunks# %zu", buf.first, buf.second, BufferPtr, SizeRemain, Chunks.size()); buf.second -= count; if (!buf.second) { @@ -151,7 +151,7 @@ namespace NActors { Y_VERIFY_DEBUG(size); // transfer control to the coroutine - Y_VERIFY(Event); + Y_ABORT_UNLESS(Event); Chunks.clear(); Resume(); @@ -159,21 +159,21 @@ namespace NActors { } void TCoroutineChunkSerializer::SetSerializingEvent(const IEventBase *event) { - Y_VERIFY(Event == nullptr); + Y_ABORT_UNLESS(Event == nullptr); Event = event; TotalSerializedDataSize = 0; AbortFlag = false; } void TCoroutineChunkSerializer::Abort() { - Y_VERIFY(Event); + Y_ABORT_UNLESS(Event); AbortFlag = true; Resume(); } void TCoroutineChunkSerializer::DoRun() { while (!CancelFlag) { - Y_VERIFY(Event); + Y_ABORT_UNLESS(Event); SerializationSuccess = !AbortFlag && Event->SerializeToArcadiaStream(this); Event = nullptr; if (!CancelFlag) { // cancel flag may have been received during serialization @@ -208,7 +208,7 @@ namespace NActors { } bool TAllocChunkSerializer::WriteAliasedRaw(const void*, int) { - Y_VERIFY(false); + Y_ABORT_UNLESS(false); return false; } diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h index a4fdb33fb4..b6789df2fc 100644 --- a/library/cpp/actors/core/event_pb.h +++ b/library/cpp/actors/core/event_pb.h @@ -303,7 +303,7 @@ namespace NActors { } const TRope& GetPayload(ui32 id) const { - Y_VERIFY(id < Payload.size()); + Y_ABORT_UNLESS(id < Payload.size()); return Payload[id]; } @@ -352,7 +352,7 @@ namespace NActors { total += section.Size; } size_t serialized = CalculateSerializedSize(); - Y_VERIFY(total == serialized, "total# %zu serialized# %zu byteSize# %zd Payload.size# %zu", total, + Y_ABORT_UNLESS(total == serialized, "total# %zu serialized# %zu byteSize# %zd Payload.size# %zu", total, serialized, byteSize, Payload.size()); #endif } diff --git a/library/cpp/actors/core/events_undelivered.cpp b/library/cpp/actors/core/events_undelivered.cpp index 70b9ea2d71..7804d5c09d 100644 --- a/library/cpp/actors/core/events_undelivered.cpp +++ b/library/cpp/actors/core/events_undelivered.cpp @@ -7,7 +7,7 @@ namespace NActors { } bool TEvents::TEvUndelivered::SerializeToArcadiaStream(TChunkSerializer *serializer) const { - Y_VERIFY(!Unsure); // these are local-only events generated by Interconnect + Y_ABORT_UNLESS(!Unsure); // these are local-only events generated by Interconnect return serializer->WriteString(&Data); } @@ -31,7 +31,7 @@ namespace NActors { IEventBase* TEvents::TEvUndelivered::Load(TEventSerializedData* bufs) { TString str = bufs->GetString(); - Y_VERIFY(str.size() == (sizeof(ui32) + sizeof(ui32))); + Y_ABORT_UNLESS(str.size() == (sizeof(ui32) + sizeof(ui32))); const char* p = str.data(); const ui64 sourceType = ReadUnaligned<ui32>(p + 0); const ui64 reason = ReadUnaligned<ui32>(p + 4); diff --git a/library/cpp/actors/core/executor_pool_base.cpp b/library/cpp/actors/core/executor_pool_base.cpp index ba7ab0e7be..3658736a7c 100644 --- a/library/cpp/actors/core/executor_pool_base.cpp +++ b/library/cpp/actors/core/executor_pool_base.cpp @@ -39,8 +39,8 @@ namespace NActors { } auto accountUsage = [&](ui32 activityType, double usage) { - Y_VERIFY(0 <= usage); - Y_VERIFY(usage <= 1); + Y_ABORT_UNLESS(0 <= usage); + Y_ABORT_UNLESS(usage <= 1); int bin = Min<int>(9, usage * 10); ++stats.UsageByActivity[activityType][bin]; }; @@ -50,7 +50,7 @@ namespace NActors { with_lock (StuckObserverMutex) { for (size_t i = 0; i < Actors.size(); ++i) { IActor *actor = Actors[i]; - Y_VERIFY(actor->StuckIndex == i); + Y_ABORT_UNLESS(actor->StuckIndex == i); const TDuration delta = now - actor->LastReceiveTimestamp; if (delta > TDuration::Seconds(30)) { ++stats.StuckActorsByActivity[actor->GetActivityType()]; @@ -137,7 +137,7 @@ namespace NActors { Y_VERIFY_DEBUG(at < Stats.ActorsAliveByActivity.size()); if (at >= Stats.MaxActivityType()) { at = TActorTypeOperator::GetActorActivityIncorrectIndex(); - Y_VERIFY(at < Stats.ActorsAliveByActivity.size()); + Y_ABORT_UNLESS(at < Stats.ActorsAliveByActivity.size()); } AtomicIncrement(Stats.ActorsAliveByActivity[at]); #endif @@ -179,7 +179,7 @@ namespace NActors { #ifdef ACTORSLIB_COLLECT_EXEC_STATS if (ActorSystem->MonitorStuckActors()) { with_lock (StuckObserverMutex) { - Y_VERIFY(actor->StuckIndex == Max<size_t>()); + Y_ABORT_UNLESS(actor->StuckIndex == Max<size_t>()); actor->StuckIndex = Actors.size(); Actors.push_back(actor); } @@ -236,7 +236,7 @@ namespace NActors { #ifdef ACTORSLIB_COLLECT_EXEC_STATS if (ActorSystem->MonitorStuckActors()) { with_lock (StuckObserverMutex) { - Y_VERIFY(actor->StuckIndex == Max<size_t>()); + Y_ABORT_UNLESS(actor->StuckIndex == Max<size_t>()); actor->StuckIndex = Actors.size(); Actors.push_back(actor); } diff --git a/library/cpp/actors/core/executor_pool_basic.cpp b/library/cpp/actors/core/executor_pool_basic.cpp index 54b6e26268..762ab32190 100644 --- a/library/cpp/actors/core/executor_pool_basic.cpp +++ b/library/cpp/actors/core/executor_pool_basic.cpp @@ -162,7 +162,7 @@ namespace NActors { #endif TAtomic state = AtomicLoad(&threadCtx.WaitingFlag); - Y_VERIFY(state == TThreadCtx::WS_NONE, "WaitingFlag# %d", int(state)); + Y_ABORT_UNLESS(state == TThreadCtx::WS_NONE, "WaitingFlag# %d", int(state)); if (SpinThreshold > 0 && !needToBlock) { // spin configured period diff --git a/library/cpp/actors/core/executor_pool_basic_ut.cpp b/library/cpp/actors/core/executor_pool_basic_ut.cpp index ecc889211f..516eeda2c6 100644 --- a/library/cpp/actors/core/executor_pool_basic_ut.cpp +++ b/library/cpp/actors/core/executor_pool_basic_ut.cpp @@ -73,7 +73,7 @@ private: Y_UNUSED(ev); Action(); TAtomicBase count = AtomicDecrement(Counter); - Y_VERIFY(count != Max<TAtomicBase>()); + Y_ABORT_UNLESS(count != Max<TAtomicBase>()); if (count) { Send(Receiver, new TEvMsg()); } diff --git a/library/cpp/actors/core/executor_pool_united.cpp b/library/cpp/actors/core/executor_pool_united.cpp index 2e689dec59..a4a9b26269 100644 --- a/library/cpp/actors/core/executor_pool_united.cpp +++ b/library/cpp/actors/core/executor_pool_united.cpp @@ -258,7 +258,7 @@ namespace NActors { // Set specified pool as current, it requires scan for (Current = 0; Current < Size && pool != Items[Current].GetPoolId(); Current++) {} - Y_VERIFY(Current < Size); + Y_ABORT_UNLESS(Current < Size); } // Account currently running pool till now (ts) @@ -266,7 +266,7 @@ namespace NActors { // Skip time slice for the first run and when time goes backwards (e.g. rdtsc is reset to zero on cpu reset) if (Y_LIKELY(Ts > 0 && Ts <= ts)) { TPoolId pool = CurrentPool(); - Y_VERIFY(pool < MaxPools); + Y_ABORT_UNLESS(pool < MaxPools); Items[Current].Account(MinVRunTs, (ts - Ts) * InvWeights[pool]); } Ts = ts; // propagate time @@ -370,7 +370,7 @@ namespace NActors { // Select pool to execute wctx.PoolId = United->AssignedPool(wctx); - Y_VERIFY(wctx.PoolId != CpuShared); + Y_ABORT_UNLESS(wctx.PoolId != CpuShared); if (United->TryAcquireToken(wctx.PoolId)) { return true; } @@ -1123,7 +1123,7 @@ namespace NActors { // NOTE: leave gaps for not united pools (default-initialized) for (const TUnitedExecutorPoolConfig& cfg : unitedPools) { TPool& pool = Pools[cfg.PoolId]; - Y_VERIFY(cfg.PoolId < MaxPools); + Y_ABORT_UNLESS(cfg.PoolId < MaxPools); pool.PoolId = cfg.PoolId; pool.Concurrency = cfg.Concurrency ? cfg.Concurrency : Config.CpuCount; pool.ExecutorPool = nullptr; // should be set later using SetupPool() @@ -1173,7 +1173,7 @@ namespace NActors { cpu.LocalManager->AddWorker(workerId); // Setup worker - Y_VERIFY(workerId < WorkerCount); + Y_ABORT_UNLESS(workerId < WorkerCount); Workers[workerId].Thread.Reset(new TExecutorThread( workerId, cpu.CpuId, diff --git a/library/cpp/actors/core/executor_pool_united_ut.cpp b/library/cpp/actors/core/executor_pool_united_ut.cpp index 2871e016fe..df3e2d29d8 100644 --- a/library/cpp/actors/core/executor_pool_united_ut.cpp +++ b/library/cpp/actors/core/executor_pool_united_ut.cpp @@ -78,7 +78,7 @@ private: Y_UNUSED(ev); Action(); TAtomicBase count = AtomicDecrement(Counter); - Y_VERIFY(count != Max<TAtomicBase>()); + Y_ABORT_UNLESS(count != Max<TAtomicBase>()); if (count) { Send(Receiver, new TEvMsg()); } diff --git a/library/cpp/actors/core/interconnect.cpp b/library/cpp/actors/core/interconnect.cpp index 192fb68769..8671fb2db7 100644 --- a/library/cpp/actors/core/interconnect.cpp +++ b/library/cpp/actors/core/interconnect.cpp @@ -59,14 +59,14 @@ namespace NActors { for (int i = 0, count = descriptor->field_count(); i < count; ++i) { const NProtoBuf::FieldDescriptor *field = descriptor->field(i); if (reflection->HasField(*locp, field)) { - Y_VERIFY(field->type() == NProtoBuf::FieldDescriptor::TYPE_STRING, "Location# %s", makeString().data()); + Y_ABORT_UNLESS(field->type() == NProtoBuf::FieldDescriptor::TYPE_STRING, "Location# %s", makeString().data()); Items.emplace_back(TKeys::E(field->number()), reflection->GetString(*locp, field)); } } const NProtoBuf::UnknownFieldSet& unknown = locp->unknown_fields(); for (int i = 0, count = unknown.field_count(); i < count; ++i) { const NProtoBuf::UnknownField& field = unknown.field(i); - Y_VERIFY(field.type() == NProtoBuf::UnknownField::TYPE_LENGTH_DELIMITED, "Location# %s", makeString().data()); + Y_ABORT_UNLESS(field.type() == NProtoBuf::UnknownField::TYPE_LENGTH_DELIMITED, "Location# %s", makeString().data()); Items.emplace_back(TKeys::E(field.number()), field.length_delimited()); } std::sort(Items.begin(), Items.end()); @@ -86,7 +86,7 @@ namespace NActors { NActorsInterconnect::TNodeLocation TNodeLocation::ParseLocation(const TString& s) { NActorsInterconnect::TNodeLocation res; const bool success = res.ParseFromString(s); - Y_VERIFY(success); + Y_ABORT_UNLESS(success); return res; } @@ -134,7 +134,7 @@ namespace NActors { Serialize(&pb, false); TString s; const bool success = pb.SerializeToString(&s); - Y_VERIFY(success); + Y_ABORT_UNLESS(success); return s; } @@ -153,7 +153,7 @@ namespace NActors { case TKeys::Module: { const bool success = TryFromString(value, moduleId); - Y_VERIFY(success); + Y_ABORT_UNLESS(success); break; } @@ -166,7 +166,7 @@ namespace NActors { case TKeys::Unit: { const bool success = TryFromString(value, unitId); - Y_VERIFY(success); + Y_ABORT_UNLESS(success); break; } diff --git a/library/cpp/actors/core/invoke.h b/library/cpp/actors/core/invoke.h index e22d500853..6151c32bfa 100644 --- a/library/cpp/actors/core/invoke.h +++ b/library/cpp/actors/core/invoke.h @@ -50,7 +50,7 @@ namespace NActors { if constexpr (std::is_same_v<TArg, std::exception_ptr>) { std::rethrow_exception(arg); } else if constexpr (std::is_void_v<T>) { - Y_VERIFY(!arg.has_value()); + Y_ABORT_UNLESS(!arg.has_value()); } else if (auto *value = std::any_cast<T>(&arg)) { return std::move(*value); } else { @@ -122,7 +122,7 @@ namespace NActors { } void StateFunc(STFUNC_SIG) { - Y_VERIFY(ev->GetTypeRewrite() == TEvents::TSystem::Wakeup); + Y_ABORT_UNLESS(ev->GetTypeRewrite() == TEvents::TSystem::Wakeup); auto g = TBase::PassAwayGuard(); Executor(); } diff --git a/library/cpp/actors/core/io_dispatcher.cpp b/library/cpp/actors/core/io_dispatcher.cpp index 6bd753f2e0..c7d28c63e0 100644 --- a/library/cpp/actors/core/io_dispatcher.cpp +++ b/library/cpp/actors/core/io_dispatcher.cpp @@ -79,7 +79,7 @@ namespace NActors { void StopOne() { with_lock (Mutex) { ++NumThreadsToStop; - Y_VERIFY(NumThreadsToStop); + Y_ABORT_UNLESS(NumThreadsToStop); } CondVar.Signal(); } @@ -144,7 +144,7 @@ namespace NActors { } void StopThread() { - Y_VERIFY(Threads.size()); + Y_ABORT_UNLESS(Threads.size()); TaskQueue.StopOne(); *NumThreads = --NumRunningThreads; ++*ThreadsStopped; @@ -185,7 +185,7 @@ namespace NActors { void HandleThreadStopped(TAutoPtr<IEventHandle> ev) { auto it = Threads.find(ev->Cookie); - Y_VERIFY(it != Threads.end()); + Y_ABORT_UNLESS(it != Threads.end()); it->second->Join(); Threads.erase(it); } diff --git a/library/cpp/actors/core/log.cpp b/library/cpp/actors/core/log.cpp index 71b5d46c22..18f43a2fed 100644 --- a/library/cpp/actors/core/log.cpp +++ b/library/cpp/actors/core/log.cpp @@ -529,7 +529,7 @@ namespace NActors { struct tm localTime; time.LocalTime(&localTime); int r = strftime(buf, TimeBufSize, "%Y-%m-%d-%H-%M-%S", &localTime); - Y_VERIFY(r != 0); + Y_ABORT_UNLESS(r != 0); return buf; } @@ -671,7 +671,7 @@ namespace NActors { } void Pop(const TLogContextGuard& context) { - Y_VERIFY(Stack.size() && Stack.back().GetId() == context.GetId()); + Y_ABORT_UNLESS(Stack.size() && Stack.back().GetId() == context.GetId()); Stack.pop_back(); } diff --git a/library/cpp/actors/core/log_settings.cpp b/library/cpp/actors/core/log_settings.cpp index 321af18d71..fafaf892eb 100644 --- a/library/cpp/actors/core/log_settings.cpp +++ b/library/cpp/actors/core/log_settings.cpp @@ -51,8 +51,8 @@ namespace NActors { } void TSettings::Append(EComponent minVal, EComponent maxVal, EComponentToStringFunc func) { - Y_VERIFY(minVal >= 0, "NLog::TSettings: minVal must be non-negative"); - Y_VERIFY(maxVal > minVal, "NLog::TSettings: maxVal must be greater than minVal"); + Y_ABORT_UNLESS(minVal >= 0, "NLog::TSettings: minVal must be non-negative"); + Y_ABORT_UNLESS(maxVal > minVal, "NLog::TSettings: maxVal must be greater than minVal"); // update bounds if (!MaxVal || minVal < MinVal) { @@ -83,7 +83,7 @@ namespace NActors { // assign new names but validate if newly added members were not used before for (int i = minVal; i <= maxVal; i++) { - Y_VERIFY(!ComponentNames[i], "component name at %d already set: %s", + Y_ABORT_UNLESS(!ComponentNames[i], "component name at %d already set: %s", i, ComponentNames[i].data()); ComponentNames[i] = func(i); } diff --git a/library/cpp/actors/core/mailbox.cpp b/library/cpp/actors/core/mailbox.cpp index b28fdc0771..de746f0ecb 100644 --- a/library/cpp/actors/core/mailbox.cpp +++ b/library/cpp/actors/core/mailbox.cpp @@ -45,7 +45,7 @@ namespace NActors { const ui32 sx = TMailbox::AlignedSize(); for (ui8* x = begin; x + sx <= end; x += sx) { TMailbox* mailbox = reinterpret_cast<TMailbox*>(x); - Y_VERIFY(IsGoodForCleanup(mailbox)); + Y_ABORT_UNLESS(IsGoodForCleanup(mailbox)); mailbox->ExecutionState = Max<ui32>(); mailbox->~TMailbox(); } @@ -57,7 +57,7 @@ namespace NActors { bool done = true; for (ui8* x = begin; x + sx <= end; x += sx) { TMailbox* mailbox = reinterpret_cast<TMailbox*>(x); - Y_VERIFY(IsGoodForCleanup(mailbox)); + Y_ABORT_UNLESS(IsGoodForCleanup(mailbox)); done &= mailbox->CleanupActors() && mailbox->CleanupEvents(); } return done; @@ -138,7 +138,7 @@ namespace NActors { const ui32 lineIndex = (hint & LineIndexMask) >> LineIndexShift; const ui32 lineHint = hint & LineHintMask; - Y_VERIFY((lineIndex < MaxLines) && (lineHint < LineSize / 64)); + Y_ABORT_UNLESS((lineIndex < MaxLines) && (lineHint < LineSize / 64)); if (lineHint == 0) return nullptr; @@ -172,7 +172,7 @@ namespace NActors { const ui32 lineIndex = (hint & LineIndexMask) >> LineIndexShift; const ui32 lineHint = hint & LineHintMask; - Y_VERIFY((lineIndex < MaxLines) && (lineHint < LineSize / 64)); + Y_ABORT_UNLESS((lineIndex < MaxLines) && (lineHint < LineSize / 64)); if (lineHint == 0) return false; diff --git a/library/cpp/actors/core/mailbox.h b/library/cpp/actors/core/mailbox.h index 0f1c3abc10..0daafa83ac 100644 --- a/library/cpp/actors/core/mailbox.h +++ b/library/cpp/actors/core/mailbox.h @@ -222,7 +222,7 @@ namespace NActors { switch (ActorPack) { case TMailboxActorPack::Simple: { - Y_VERIFY(ActorsInfo.Simple.ActorId == localActorId); + Y_ABORT_UNLESS(ActorsInfo.Simple.ActorId == localActorId); actorToDestruct = ActorsInfo.Simple.Actor; ActorsInfo.Simple.ActorId = 0; @@ -231,7 +231,7 @@ namespace NActors { } case TMailboxActorPack::Map: { TActorMap::iterator it = ActorsInfo.Map.ActorsMap->find(localActorId); - Y_VERIFY(it != ActorsInfo.Map.ActorsMap->end()); + Y_ABORT_UNLESS(it != ActorsInfo.Map.ActorsMap->end()); actorToDestruct = it->second; ActorsInfo.Map.ActorsMap->erase(it); @@ -260,7 +260,7 @@ namespace NActors { break; } } - Y_VERIFY(found); + Y_ABORT_UNLESS(found); if (ActorsInfo.Array.ActorsCount == 1) { const TActorPair Actor = ActorsInfo.Array.ActorsArray->Actors[0]; diff --git a/library/cpp/actors/core/mailbox_queue_revolving.h b/library/cpp/actors/core/mailbox_queue_revolving.h index b0e78a18db..22b0332095 100644 --- a/library/cpp/actors/core/mailbox_queue_revolving.h +++ b/library/cpp/actors/core/mailbox_queue_revolving.h @@ -173,7 +173,7 @@ namespace NActors { } bool TryPush(T x) { - Y_VERIFY(x != 0); + Y_ABORT_UNLESS(x != 0); for (ui32 i = 0; i != TWriteConcurrency; ++i) { if (RelaxedLoad(&WriteTo[i]) != nullptr) { diff --git a/library/cpp/actors/core/mon.h b/library/cpp/actors/core/mon.h index ca2001e5f6..ba5debbd17 100644 --- a/library/cpp/actors/core/mon.h +++ b/library/cpp/actors/core/mon.h @@ -96,7 +96,7 @@ namespace NActors { static TString MakeSerializedQuery(const NActorsProto::TRemoteHttpInfo& info) { TString s(1, '\0'); const bool success = info.AppendToString(&s); - Y_VERIFY(success); + Y_ABORT_UNLESS(success); return s; } @@ -158,7 +158,7 @@ namespace NActors { res->Query = s; res->ExtendedQuery.emplace(); const bool success = res->ExtendedQuery->ParseFromZeroCopyStream(&stream); - Y_VERIFY(success); + Y_ABORT_UNLESS(success); return res.release(); } else { return new TEvRemoteHttpInfo(s); diff --git a/library/cpp/actors/core/mon_ut.cpp b/library/cpp/actors/core/mon_ut.cpp index a2991e8a10..fa5dbbe71e 100644 --- a/library/cpp/actors/core/mon_ut.cpp +++ b/library/cpp/actors/core/mon_ut.cpp @@ -16,7 +16,7 @@ Y_UNIT_TEST_SUITE(ActorSystemMon) { TAllocChunkSerializer ser; const bool success = ev->SerializeToArcadiaStream(&ser); - Y_VERIFY(success); + Y_ABORT_UNLESS(success); auto buffer = ser.Release(ev->CreateSerializationInfo()); std::unique_ptr<TEvRemoteHttpInfo> restored(dynamic_cast<TEvRemoteHttpInfo*>(TEvRemoteHttpInfo::Load(buffer.Get()))); UNIT_ASSERT(restored->Query == ev->Query); diff --git a/library/cpp/actors/core/performance_ut.cpp b/library/cpp/actors/core/performance_ut.cpp index 51d10a5e80..3c1a0ed143 100644 --- a/library/cpp/actors/core/performance_ut.cpp +++ b/library/cpp/actors/core/performance_ut.cpp @@ -100,7 +100,7 @@ Y_UNIT_TEST_SUITE(ActorSystemPerformance) { switch (ev->GetTypeRewrite()) { HFunc(TEventLocalDolbilkaOld, Handle); default: - Y_VERIFY(false); + Y_ABORT_UNLESS(false); } } @@ -162,13 +162,13 @@ Y_UNIT_TEST_SUITE(ActorSystemPerformance) { while (dNew->GetDurationInProgress() < TDuration::Seconds(1000) && !dNew->IsFinished()) { Sleep(TDuration::Seconds(1)); } - Y_VERIFY(dNew->IsFinished()); + Y_ABORT_UNLESS(dNew->IsFinished()); TDolbilkaOld* dOld = new TDolbilkaOld; runtime->Register(dOld); while (dOld->GetDurationInProgress() < TDuration::Seconds(1000) && !dOld->IsFinished()) { Sleep(TDuration::Seconds(1)); } - Y_VERIFY(dOld->IsFinished()); + Y_ABORT_UNLESS(dOld->IsFinished()); std::unique_ptr<TDolbilkaSimple> dSimple(new TDolbilkaSimple); IDolbilkaSimple* dSimpleIface = dSimple.get(); while (dSimpleIface->ProcessEvent()) { diff --git a/library/cpp/actors/core/scheduler_actor.cpp b/library/cpp/actors/core/scheduler_actor.cpp index db2bcf2791..513505b5d7 100644 --- a/library/cpp/actors/core/scheduler_actor.cpp +++ b/library/cpp/actors/core/scheduler_actor.cpp @@ -21,7 +21,7 @@ namespace NActors { TTimerDescriptor() : Descriptor(timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK)) { - Y_VERIFY(Descriptor != -1, "timerfd_create() failed with %s", strerror(errno)); + Y_ABORT_UNLESS(Descriptor != -1, "timerfd_create() failed with %s", strerror(errno)); } ~TTimerDescriptor() override { @@ -92,9 +92,9 @@ namespace NActors { new_time.it_value.tv_nsec = Cfg.ResolutionMicroseconds * 1000; new_time.it_interval.tv_nsec = Cfg.ResolutionMicroseconds * 1000; int ret = timerfd_settime(TimerDescriptor->GetDescriptor(), 0, &new_time, NULL); - Y_VERIFY(ret != -1, "timerfd_settime() failed with %s", strerror(errno)); + Y_ABORT_UNLESS(ret != -1, "timerfd_settime() failed with %s", strerror(errno)); const bool success = ctx.Send(PollerActor, new TEvPollerRegister(TimerDescriptor, SelfId(), {})); - Y_VERIFY(success); + Y_ABORT_UNLESS(success); RealTime = RelaxedLoad(CurrentTimestamp); MonotonicTime = RelaxedLoad(CurrentMonotonic); @@ -141,7 +141,7 @@ namespace NActors { continue; } } - Y_VERIFY(bytesRead == sizeof(expired), "Error while reading from timerfd, strerror# %s", strerror(errno)); + Y_ABORT_UNLESS(bytesRead == sizeof(expired), "Error while reading from timerfd, strerror# %s", strerror(errno)); UpdateTime(); ui32 eventsGottenFromQueues = 0; diff --git a/library/cpp/actors/core/scheduler_basic.cpp b/library/cpp/actors/core/scheduler_basic.cpp index 020f640ac0..3b4e0a08c1 100644 --- a/library/cpp/actors/core/scheduler_basic.cpp +++ b/library/cpp/actors/core/scheduler_basic.cpp @@ -43,11 +43,11 @@ namespace NActors { , StopFlag(false) , ScheduleMap(3600) { - Y_VERIFY(!Config.UseSchedulerActor, "Cannot create scheduler thread because Config.UseSchedulerActor# true"); + Y_ABORT_UNLESS(!Config.UseSchedulerActor, "Cannot create scheduler thread because Config.UseSchedulerActor# true"); } TBasicSchedulerThread::~TBasicSchedulerThread() { - Y_VERIFY(!MainCycle); + Y_ABORT_UNLESS(!MainCycle); } void TBasicSchedulerThread::CycleFunc() { @@ -220,7 +220,7 @@ namespace NActors { } void TBasicSchedulerThread::PrepareSchedules(NSchedulerQueue::TReader** readers, ui32 scheduleReadersCount) { - Y_VERIFY(scheduleReadersCount > 0); + Y_ABORT_UNLESS(scheduleReadersCount > 0); TotalReaders = scheduleReadersCount; Readers.Reset(new NSchedulerQueue::TReader*[scheduleReadersCount]); Copy(readers, readers + scheduleReadersCount, Readers.Get()); |