diff options
author | ilnurkh <ilnurkh@yandex-team.com> | 2023-10-17 08:15:44 +0300 |
---|---|---|
committer | ilnurkh <ilnurkh@yandex-team.com> | 2023-10-17 09:00:07 +0300 |
commit | 784925324fd115c37bc98c5bbfe64c15f9966d74 (patch) | |
tree | f763f6eaacfcd4757d249977aaddfa4e9b2a355b | |
parent | d6c75d9ec33559b29eb61a8f2e17cbca30fd5ae2 (diff) | |
download | ydb-784925324fd115c37bc98c5bbfe64c15f9966d74.tar.gz |
Y_FAIL->Y_ABORT at '^li'
https://clubs.at.yandex-team.ru/arcadia/29404
122 files changed, 302 insertions, 302 deletions
diff --git a/library/cpp/actors/core/actor_benchmark_helper.h b/library/cpp/actors/core/actor_benchmark_helper.h index 0671271f42..c5dd09efe1 100644 --- a/library/cpp/actors/core/actor_benchmark_helper.h +++ b/library/cpp/actors/core/actor_benchmark_helper.h @@ -325,7 +325,7 @@ struct TActorBenchmark { } return setup; } - Y_FAIL(); + Y_ABORT(); } static double BenchSendReceive(bool allocation, NActors::TMailboxType::EType mType, EPoolType poolType, ESendingType sendingType) { diff --git a/library/cpp/actors/core/actor_coroutine.cpp b/library/cpp/actors/core/actor_coroutine.cpp index 9b0c81fa26..32390eaae3 100644 --- a/library/cpp/actors/core/actor_coroutine.cpp +++ b/library/cpp/actors/core/actor_coroutine.cpp @@ -67,7 +67,7 @@ namespace NActors { return nullptr; // it is not a race -- we've got timeout exactly for our current wait } } - Y_FAIL("no pending event"); + Y_ABORT("no pending event"); } bool TActorCoroImpl::ProcessEvent(THolder<IEventHandle> ev) { @@ -127,12 +127,12 @@ namespace NActors { Run(); } catch (const TDtorException& /*ex*/) { if (!AllowUnhandledDtor) { - Y_FAIL("unhandled TDtorException"); + Y_ABORT("unhandled TDtorException"); } } catch (const std::exception& ex) { - Y_FAIL("unhandled exception of type %s", TypeName(ex).data()); + Y_ABORT("unhandled exception of type %s", TypeName(ex).data()); } catch (...) { - Y_FAIL("unhandled exception of type not derived from std::exception"); + Y_ABORT("unhandled exception of type not derived from std::exception"); } } Finished = true; diff --git a/library/cpp/actors/core/actor_virtual.h b/library/cpp/actors/core/actor_virtual.h index 5598312952..78da45138d 100644 --- a/library/cpp/actors/core/actor_virtual.h +++ b/library/cpp/actors/core/actor_virtual.h @@ -70,7 +70,7 @@ public: } virtual bool SerializeToArcadiaStream(TChunkSerializer* /*serializer*/) const override { - Y_FAIL("Serialization of local event %s->%s", typeid(TEvent).name(), typeid(TActor).name()); + Y_ABORT("Serialization of local event %s->%s", typeid(TEvent).name(), typeid(TActor).name()); } virtual bool IsSerializable() const override { @@ -78,7 +78,7 @@ public: } static IEventBase* Load(TEventSerializedData*) { - Y_FAIL("Loading of local event %s->%s", typeid(TEvent).name(), typeid(TActor).name()); + Y_ABORT("Loading of local event %s->%s", typeid(TEvent).name(), typeid(TActor).name()); } }; diff --git a/library/cpp/actors/core/balancer.cpp b/library/cpp/actors/core/balancer.cpp index e09c834543..5e8a280a8b 100644 --- a/library/cpp/actors/core/balancer.cpp +++ b/library/cpp/actors/core/balancer.cpp @@ -294,7 +294,7 @@ namespace NActors { return; } } - Y_FAIL(); + Y_ABORT(); } void TBalancer::Unlock() { diff --git a/library/cpp/actors/core/config.h b/library/cpp/actors/core/config.h index 38aaf77797..7c843d0847 100644 --- a/library/cpp/actors/core/config.h +++ b/library/cpp/actors/core/config.h @@ -122,7 +122,7 @@ namespace NActors { return p.PoolName; } } - Y_FAIL("undefined pool id: %" PRIu32, (ui32)poolId); + Y_ABORT("undefined pool id: %" PRIu32, (ui32)poolId); } std::optional<ui32> GetThreadsOptional(ui32 poolId) const { diff --git a/library/cpp/actors/core/cpu_manager.cpp b/library/cpp/actors/core/cpu_manager.cpp index df4ea486e4..24b3161e3c 100644 --- a/library/cpp/actors/core/cpu_manager.cpp +++ b/library/cpp/actors/core/cpu_manager.cpp @@ -132,7 +132,7 @@ namespace NActors { return result; } } - Y_FAIL("missing PoolId: %d", int(poolId)); + Y_ABORT("missing PoolId: %d", int(poolId)); } TVector<IExecutorPool*> TCpuManager::GetBasicExecutorPools() const { diff --git a/library/cpp/actors/core/event.h b/library/cpp/actors/core/event.h index e7f561338f..3517dc7a68 100644 --- a/library/cpp/actors/core/event.h +++ b/library/cpp/actors/core/event.h @@ -75,7 +75,7 @@ namespace NActors { template <typename TEventType> TEventType* Get() { if (Type != TEventType::EventType) - Y_FAIL("Event type %" PRIu32 " doesn't match the expected type %" PRIu32, Type, TEventType::EventType); + Y_ABORT("Event type %" PRIu32 " doesn't match the expected type %" PRIu32, Type, TEventType::EventType); if (!Event) { static TEventSerializedData empty; @@ -86,7 +86,7 @@ namespace NActors { return static_cast<TEventType*>(Event.Get()); } - Y_FAIL("Failed to Load() event type %" PRIu32 " class %s", Type, TypeName<TEventType>().data()); + Y_ABORT("Failed to Load() event type %" PRIu32 " class %s", Type, TypeName<TEventType>().data()); } template <typename T> @@ -364,10 +364,10 @@ namespace NActors { return TString(header); \ } \ bool SerializeToArcadiaStream(NActors::TChunkSerializer*) const override { \ - Y_FAIL("Local event " #eventType " is not serializable"); \ + Y_ABORT("Local event " #eventType " is not serializable"); \ } \ static IEventBase* Load(NActors::TEventSerializedData*) { \ - Y_FAIL("Local event " #eventType " has no load method"); \ + Y_ABORT("Local event " #eventType " has no load method"); \ } \ bool IsSerializable() const override { \ return false; \ diff --git a/library/cpp/actors/core/event_local.h b/library/cpp/actors/core/event_local.h index 2845aa94dd..da0f740ba8 100644 --- a/library/cpp/actors/core/event_local.h +++ b/library/cpp/actors/core/event_local.h @@ -14,7 +14,7 @@ namespace NActors { } bool SerializeToArcadiaStream(TChunkSerializer* /*serializer*/) const override { - Y_FAIL("Serialization of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType); + Y_ABORT("Serialization of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType); } bool IsSerializable() const override { @@ -22,7 +22,7 @@ namespace NActors { } static IEventBase* Load(TEventSerializedData*) { - Y_FAIL("Loading of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType); + Y_ABORT("Loading of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType); } }; diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h index d3b422f1dc..5fce7c830f 100644 --- a/library/cpp/actors/core/event_pb.h +++ b/library/cpp/actors/core/event_pb.h @@ -213,7 +213,7 @@ namespace NActors { if (const auto& info = input->GetSerializationInfo(); info.IsExtendedFormat) { // check marker if (!iter.Valid() || (*iter.ContiguousData() != PayloadMarker && *iter.ContiguousData() != ExtendedPayloadMarker)) { - Y_FAIL("invalid event"); + Y_ABORT("invalid event"); } const bool dataIsSeparate = *iter.ContiguousData() == ExtendedPayloadMarker; // ropes go after sizes @@ -232,7 +232,7 @@ namespace NActors { // parse number of payload ropes size_t numRopes = DeserializeNumber(iter, size); if (numRopes == Max<size_t>()) { - Y_FAIL("invalid event"); + Y_ABORT("invalid event"); } TStackVec<size_t, 16> ropeLens; if (dataIsSeparate) { @@ -242,7 +242,7 @@ namespace NActors { // parse length of the rope const size_t len = DeserializeNumber(iter, size); if (len == Max<size_t>() || size < len) { - Y_FAIL("invalid event len# %zu size# %" PRIu64, len, size); + Y_ABORT("invalid event len# %zu size# %" PRIu64, len, size); } // extract the rope if (dataIsSeparate) { @@ -259,7 +259,7 @@ namespace NActors { // parse the protobuf TRopeStream stream(iter, size); if (!ev->Record.ParseFromZeroCopyStream(&stream)) { - Y_FAIL("Failed to parse protobuf event type %" PRIu32 " class %s", TEventType, TypeName(ev->Record).data()); + Y_ABORT("Failed to parse protobuf event type %" PRIu32 " class %s", TEventType, TypeName(ev->Record).data()); } } ev->CachedByteSize = input->GetSize(); diff --git a/library/cpp/actors/core/executor_pool_base.cpp b/library/cpp/actors/core/executor_pool_base.cpp index d58cd6ce08..059cac48d2 100644 --- a/library/cpp/actors/core/executor_pool_base.cpp +++ b/library/cpp/actors/core/executor_pool_base.cpp @@ -206,7 +206,7 @@ namespace NActors { UnlockFromExecution((TMailboxTable::TTinyReadAsFilledMailbox*)mailbox, this, false, hint, MaxWorkers, ++revolvingWriteCounter); break; default: - Y_FAIL(); + Y_ABORT(); } NHPTimer::STime elapsed = GetCycleCountFast() - hpstart; diff --git a/library/cpp/actors/core/executor_pool_basic.cpp b/library/cpp/actors/core/executor_pool_basic.cpp index f9ea74a920..bb36fce894 100644 --- a/library/cpp/actors/core/executor_pool_basic.cpp +++ b/library/cpp/actors/core/executor_pool_basic.cpp @@ -352,7 +352,7 @@ namespace NActors { } break; default: - Y_FAIL(); + Y_ABORT(); } } } @@ -530,7 +530,7 @@ namespace NActors { pthread_t threadSelf = pthread_self(); sched_param param = {RealtimePriority}; if (pthread_setschedparam(threadSelf, SCHED_FIFO, ¶m)) { - Y_FAIL("Cannot set realtime priority"); + Y_ABORT("Cannot set realtime priority"); } } #else diff --git a/library/cpp/actors/core/executor_pool_united.cpp b/library/cpp/actors/core/executor_pool_united.cpp index a21fd2d1a7..960545ffb5 100644 --- a/library/cpp/actors/core/executor_pool_united.cpp +++ b/library/cpp/actors/core/executor_pool_united.cpp @@ -526,7 +526,7 @@ namespace NActors { FastWorkerSleep(GetCycleCountFast() + Config.SoftLimitTs); break; case Stopped: return false; - default: Y_FAIL(); + default: Y_ABORT(); } } } else if (wctx.Lease.IsNeverExpiring()) { // if idle-worker @@ -542,7 +542,7 @@ namespace NActors { idleTimer->Wait(); break; case Stopped: return false; - default: Y_FAIL(); + default: Y_ABORT(); } } else { // lease has expired and hard preemption occured, so we are executing in a slow-worker wctx.IncrementPreemptedEvents(); @@ -556,7 +556,7 @@ namespace NActors { idleTimer = nullptr; break; case Stopped: return false; - default: Y_FAIL(); + default: Y_ABORT(); } } } @@ -693,7 +693,7 @@ namespace NActors { return; } } else { - Y_FAIL("two slow-workers executing the same pool on the same core"); + Y_ABORT("two slow-workers executing the same pool on the same core"); return; // pool is already slow } } @@ -706,7 +706,7 @@ namespace NActors { void EndHardPreemption(TWorkerId to) { ATOMIC_COMPILER_BARRIER(); if (!AtomicCas(&CurrentLease, TLease(to, NeverExpire), HardPreemptionLease)) { - Y_FAIL("hard preemption failed"); + Y_ABORT("hard preemption failed"); } } @@ -717,7 +717,7 @@ namespace NActors { void EnablePreemptionAndGrant(TLease lease) { ATOMIC_COMPILER_BARRIER(); if (!AtomicCas(&CurrentLease, lease, lease.NeverExpire())) { - Y_FAIL("lease grant failed"); + Y_ABORT("lease grant failed"); } } @@ -789,7 +789,7 @@ namespace NActors { switch (ret) { case 0: return; case EINVAL: - Y_FAIL("sched_setscheduler(%" PRIu64 ", %d, %d) -> EINVAL", tid, policy, param.sched_priority); + Y_ABORT("sched_setscheduler(%" PRIu64 ", %d, %d) -> EINVAL", tid, policy, param.sched_priority); case EPERM: // Requirements: // * CAP_SYS_NICE capability to run real-time processes and set cpu affinity. @@ -802,11 +802,11 @@ namespace NActors { // echo -1 > /sys/fs/cgroup/cpu/[cgroup]/cpu.rt_runtime_us // (also set the same value for every parent cgroup) // https://www.kernel.org/doc/Documentation/scheduler/sched-rt-group.txt - Y_FAIL("sched_setscheduler(%" PRIu64 ", %d, %d) -> EPERM", tid, policy, param.sched_priority); + Y_ABORT("sched_setscheduler(%" PRIu64 ", %d, %d) -> EPERM", tid, policy, param.sched_priority); case ESRCH: - Y_FAIL("sched_setscheduler(%" PRIu64 ", %d, %d) -> ESRCH", tid, policy, param.sched_priority); + Y_ABORT("sched_setscheduler(%" PRIu64 ", %d, %d) -> ESRCH", tid, policy, param.sched_priority); default: - Y_FAIL("sched_setscheduler(%" PRIu64 ", %d, %d) -> %d", tid, policy, param.sched_priority, ret); + Y_ABORT("sched_setscheduler(%" PRIu64 ", %d, %d) -> %d", tid, policy, param.sched_priority, ret); } #else Y_UNUSED(tid); @@ -865,23 +865,23 @@ namespace NActors { } // Should never be called - void ReclaimMailbox(TMailboxType::EType, ui32, TWorkerId, ui64) override { Y_FAIL(); } - TMailboxHeader *ResolveMailbox(ui32) override { Y_FAIL(); } - void Schedule(TInstant, TAutoPtr<IEventHandle>, ISchedulerCookie*, TWorkerId) override { Y_FAIL(); } - void Schedule(TMonotonic, TAutoPtr<IEventHandle>, ISchedulerCookie*, TWorkerId) override { Y_FAIL(); } - void Schedule(TDuration, TAutoPtr<IEventHandle>, ISchedulerCookie*, TWorkerId) override { Y_FAIL(); } - bool Send(TAutoPtr<IEventHandle>&) override { Y_FAIL(); } - bool SpecificSend(TAutoPtr<IEventHandle>&) override { Y_FAIL(); } - void ScheduleActivation(ui32) override { Y_FAIL(); } - void SpecificScheduleActivation(ui32) override { Y_FAIL(); } - void ScheduleActivationEx(ui32, ui64) override { Y_FAIL(); } - TActorId Register(IActor*, TMailboxType::EType, ui64, const TActorId&) override { Y_FAIL(); } - TActorId Register(IActor*, TMailboxHeader*, ui32, const TActorId&) override { Y_FAIL(); } - void Prepare(TActorSystem*, NSchedulerQueue::TReader**, ui32*) override { Y_FAIL(); } - void Start() override { Y_FAIL(); } - void PrepareStop() override { Y_FAIL(); } - void Shutdown() override { Y_FAIL(); } - bool Cleanup() override { Y_FAIL(); } + void ReclaimMailbox(TMailboxType::EType, ui32, TWorkerId, ui64) override { Y_ABORT(); } + TMailboxHeader *ResolveMailbox(ui32) override { Y_ABORT(); } + void Schedule(TInstant, TAutoPtr<IEventHandle>, ISchedulerCookie*, TWorkerId) override { Y_ABORT(); } + void Schedule(TMonotonic, TAutoPtr<IEventHandle>, ISchedulerCookie*, TWorkerId) override { Y_ABORT(); } + void Schedule(TDuration, TAutoPtr<IEventHandle>, ISchedulerCookie*, TWorkerId) override { Y_ABORT(); } + bool Send(TAutoPtr<IEventHandle>&) override { Y_ABORT(); } + bool SpecificSend(TAutoPtr<IEventHandle>&) override { Y_ABORT(); } + void ScheduleActivation(ui32) override { Y_ABORT(); } + void SpecificScheduleActivation(ui32) override { Y_ABORT(); } + void ScheduleActivationEx(ui32, ui64) override { Y_ABORT(); } + TActorId Register(IActor*, TMailboxType::EType, ui64, const TActorId&) override { Y_ABORT(); } + TActorId Register(IActor*, TMailboxHeader*, ui32, const TActorId&) override { Y_ABORT(); } + void Prepare(TActorSystem*, NSchedulerQueue::TReader**, ui32*) override { Y_ABORT(); } + void Start() override { Y_ABORT(); } + void PrepareStop() override { Y_ABORT(); } + void Shutdown() override { Y_ABORT(); } + bool Cleanup() override { Y_ABORT(); } }; // Proxy executor pool working with cpu-local scheduler (aka actorsystem 2.0) @@ -1058,7 +1058,7 @@ namespace NActors { return token; } case TCpuState::Forbidden: - Y_FAIL(); + Y_ABORT(); case TCpuState::Stopped: return CpuStopped; } @@ -1401,7 +1401,7 @@ namespace NActors { } TAffinity* TUnitedExecutorPool::Affinity() const { - Y_FAIL(); // should never be called, TCpuExecutorPool is used instead + Y_ABORT(); // should never be called, TCpuExecutorPool is used instead } ui32 TUnitedExecutorPool::GetThreads() const { @@ -1409,7 +1409,7 @@ namespace NActors { } ui32 TUnitedExecutorPool::GetReadyActivation(TWorkerContext&, ui64) { - Y_FAIL(); // should never be called, TCpu*ExecutorPool is used instead + Y_ABORT(); // should never be called, TCpu*ExecutorPool is used instead } inline void TUnitedExecutorPool::ScheduleActivation(ui32 activation) { diff --git a/library/cpp/actors/core/executor_thread.cpp b/library/cpp/actors/core/executor_thread.cpp index deddb0a97e..eed1794ab1 100644 --- a/library/cpp/actors/core/executor_thread.cpp +++ b/library/cpp/actors/core/executor_thread.cpp @@ -539,7 +539,7 @@ namespace NActors { case TExecutionState::FreeLeavingMarked: return false; default: - Y_FAIL(); + Y_ABORT(); } } } @@ -572,7 +572,7 @@ namespace NActors { case TExecutionState::FreeLeavingMarked: return false; default: - Y_FAIL(); + Y_ABORT(); } } } @@ -587,7 +587,7 @@ namespace NActors { case TExecutionState::Leaving: case TExecutionState::Executing: case TExecutionState::LeavingMarked: - Y_FAIL(); + Y_ABORT(); case TExecutionState::Free: if (AtomicUi32Cas(&ExecutionState, TExecutionState::Executing, TExecutionState::Free)) return true; @@ -601,7 +601,7 @@ namespace NActors { case TExecutionState::FreeLeavingMarked: return false; default: - Y_FAIL(); + Y_ABORT(); } } } @@ -613,7 +613,7 @@ namespace NActors { else if (state == TExecutionState::FreeExecuting) AtomicStore(&ExecutionState, (ui32)TExecutionState::FreeLeaving); else - Y_FAIL(); + Y_ABORT(); AtomicBarrier(); } @@ -624,7 +624,7 @@ namespace NActors { switch (state) { case TExecutionState::Inactive: case TExecutionState::Scheduled: - Y_FAIL(); + Y_ABORT(); case TExecutionState::Leaving: if (!wouldReschedule) { if (AtomicUi32Cas(&ExecutionState, TExecutionState::Inactive, TExecutionState::Leaving)) @@ -635,14 +635,14 @@ namespace NActors { } break; case TExecutionState::Executing: - Y_FAIL(); + Y_ABORT(); case TExecutionState::LeavingMarked: if (AtomicUi32Cas(&ExecutionState, TExecutionState::Scheduled, TExecutionState::LeavingMarked)) return true; break; case TExecutionState::Free: case TExecutionState::FreeScheduled: - Y_FAIL(); + Y_ABORT(); case TExecutionState::FreeLeaving: if (!wouldReschedule) { if (AtomicUi32Cas(&ExecutionState, TExecutionState::Free, TExecutionState::FreeLeaving)) @@ -653,13 +653,13 @@ namespace NActors { } break; case TExecutionState::FreeExecuting: - Y_FAIL(); + Y_ABORT(); case TExecutionState::FreeLeavingMarked: if (AtomicUi32Cas(&ExecutionState, TExecutionState::FreeScheduled, TExecutionState::FreeLeavingMarked)) return true; break; default: - Y_FAIL(); + Y_ABORT(); } } } @@ -671,7 +671,7 @@ namespace NActors { switch (state) { case TExecutionState::Inactive: case TExecutionState::Scheduled: - Y_FAIL(); + Y_ABORT(); case TExecutionState::Leaving: if (!wouldReschedule) { if (AtomicUi32Cas(&ExecutionState, TExecutionState::Free, TExecutionState::Leaving)) @@ -682,7 +682,7 @@ namespace NActors { } break; case TExecutionState::Executing: - Y_FAIL(); + Y_ABORT(); case TExecutionState::LeavingMarked: if (AtomicUi32Cas(&ExecutionState, TExecutionState::FreeScheduled, TExecutionState::LeavingMarked)) return true; @@ -692,9 +692,9 @@ namespace NActors { case TExecutionState::FreeLeaving: case TExecutionState::FreeExecuting: case TExecutionState::FreeLeavingMarked: - Y_FAIL(); + Y_ABORT(); default: - Y_FAIL(); + Y_ABORT(); } } } diff --git a/library/cpp/actors/core/interconnect.cpp b/library/cpp/actors/core/interconnect.cpp index 8671fb2db7..b477f71e57 100644 --- a/library/cpp/actors/core/interconnect.cpp +++ b/library/cpp/actors/core/interconnect.cpp @@ -171,7 +171,7 @@ namespace NActors { } default: - Y_FAIL("unexpected legacy key# %d", key); + Y_ABORT("unexpected legacy key# %d", key); } } diff --git a/library/cpp/actors/core/invoke.h b/library/cpp/actors/core/invoke.h index 6151c32bfa..c9e29effe2 100644 --- a/library/cpp/actors/core/invoke.h +++ b/library/cpp/actors/core/invoke.h @@ -54,7 +54,7 @@ namespace NActors { } else if (auto *value = std::any_cast<T>(&arg)) { return std::move(*value); } else { - Y_FAIL("unspported return type for TEvInvokeResult: actual# %s != expected# %s", + Y_ABORT("unspported return type for TEvInvokeResult: actual# %s != expected# %s", TypeName(arg.type()).data(), TypeName<T>().data()); } }, Result); diff --git a/library/cpp/actors/core/log.h b/library/cpp/actors/core/log.h index 3e171b9b73..44cd3730a4 100644 --- a/library/cpp/actors/core/log.h +++ b/library/cpp/actors/core/log.h @@ -524,7 +524,7 @@ namespace NActors { ~TVerifyFormattedRecordWriter() { const TString data = TBase::GetResult(); - Y_FAIL("%s", data.data()); + Y_ABORT("%s", data.data()); } }; } diff --git a/library/cpp/actors/core/mailbox.cpp b/library/cpp/actors/core/mailbox.cpp index 37cb900ecf..d11ff9cbcb 100644 --- a/library/cpp/actors/core/mailbox.cpp +++ b/library/cpp/actors/core/mailbox.cpp @@ -36,7 +36,7 @@ namespace NActors { case TMailboxHeader::TExecutionState::FreeLeavingMarked: return false; default: - Y_FAIL(); + Y_ABORT(); } } @@ -84,7 +84,7 @@ namespace NActors { DestructMailboxLine<TTinyReadAsFilledMailbox>((ui8*)lineHeader + 64, (ui8*)lineHeader + LineSize); break; default: - Y_FAIL(); + Y_ABORT(); } lineHeader->~TMailboxLineHeader(); @@ -126,7 +126,7 @@ namespace NActors { done &= CleanupMailboxLine<TTinyReadAsFilledMailbox>((ui8*)lineHeader + 64, (ui8*)lineHeader + LineSize); break; default: - Y_FAIL(); + Y_ABORT(); } } } @@ -262,7 +262,7 @@ namespace NActors { } return true; default: - Y_FAIL("unknown mailbox type"); + Y_ABORT("unknown mailbox type"); } } @@ -319,7 +319,7 @@ namespace NActors { } while (AtomicGet(CachedTinyReadAsFilledMailboxes) > (MailboxCacheTinyReadAsFilled.Concurrency * 512)); return 0; default: - Y_FAIL("Unknown mailbox type"); + Y_ABORT("Unknown mailbox type"); } } @@ -353,7 +353,7 @@ namespace NActors { AtomicIncrement(CachedTinyReadAsFilledMailboxes); break; default: - Y_FAIL(); + Y_ABORT(); } } } @@ -557,7 +557,7 @@ namespace NActors { counter = &CachedTinyReadAsFilledMailboxes; break; default: - Y_FAIL(); + Y_ABORT(); } AtomicStore(Lines + lineIndex, header); diff --git a/library/cpp/actors/core/mailbox.h b/library/cpp/actors/core/mailbox.h index d7e3ef5384..4697dedcfd 100644 --- a/library/cpp/actors/core/mailbox.h +++ b/library/cpp/actors/core/mailbox.h @@ -168,7 +168,7 @@ namespace NActors { break; } default: - Y_FAIL(); + Y_ABORT(); } return nullptr; } @@ -211,7 +211,7 @@ namespace NActors { break; } default: - Y_FAIL(); + Y_ABORT(); } } diff --git a/library/cpp/actors/core/scheduler_cookie.cpp b/library/cpp/actors/core/scheduler_cookie.cpp index 0fa6f543a7..b975a80c07 100644 --- a/library/cpp/actors/core/scheduler_cookie.cpp +++ b/library/cpp/actors/core/scheduler_cookie.cpp @@ -24,11 +24,11 @@ namespace NActors { return false; } - Y_FAIL(); + Y_ABORT(); } bool DetachEvent() noexcept override { - Y_FAIL(); + Y_ABORT(); } }; @@ -60,7 +60,7 @@ namespace NActors { return false; } - Y_FAIL(); + Y_ABORT(); } bool DetachEvent() noexcept override { @@ -74,7 +74,7 @@ namespace NActors { return false; } - Y_FAIL(); + Y_ABORT(); } }; diff --git a/library/cpp/actors/cppcoro/task.h b/library/cpp/actors/cppcoro/task.h index 8afeb7e705..bb5a385db2 100644 --- a/library/cpp/actors/cppcoro/task.h +++ b/library/cpp/actors/cppcoro/task.h @@ -129,7 +129,7 @@ namespace NActors { struct TFinalSuspend { static bool await_ready() noexcept { return false; } - static void await_resume() noexcept { Y_FAIL("unexpected coroutine resume"); } + static void await_resume() noexcept { Y_ABORT("unexpected coroutine resume"); } static std::coroutine_handle<> await_suspend(std::coroutine_handle<TTaskPromise<T>> h) noexcept { auto next = std::exchange(h.promise().Continuation, std::noop_coroutine()); diff --git a/library/cpp/actors/cppcoro/task_actor_ut.cpp b/library/cpp/actors/cppcoro/task_actor_ut.cpp index 79d68b64c2..43186bfc55 100644 --- a/library/cpp/actors/cppcoro/task_actor_ut.cpp +++ b/library/cpp/actors/cppcoro/task_actor_ut.cpp @@ -45,7 +45,7 @@ Y_UNIT_TEST_SUITE(TaskActor) { case TEvStop::EventType: co_return false; default: - Y_FAIL("Unexpected event"); + Y_ABORT("Unexpected event"); } }; while (co_await singleRequest()) { diff --git a/library/cpp/actors/cppcoro/task_group.h b/library/cpp/actors/cppcoro/task_group.h index 5b82e5f592..1de0cf5c1e 100644 --- a/library/cpp/actors/cppcoro/task_group.h +++ b/library/cpp/actors/cppcoro/task_group.h @@ -177,7 +177,7 @@ namespace NActors { struct TFinalSuspend { static bool await_ready() noexcept { return false; } - static void await_resume() noexcept { Y_FAIL("unexpected coroutine resume"); } + static void await_resume() noexcept { Y_ABORT("unexpected coroutine resume"); } Y_NO_INLINE static std::coroutine_handle<> await_suspend(std::coroutine_handle<TTaskGroupPromise<T>> h) noexcept { diff --git a/library/cpp/actors/cppcoro/task_result.h b/library/cpp/actors/cppcoro/task_result.h index 54e66fd57f..da78c53b7a 100644 --- a/library/cpp/actors/cppcoro/task_result.h +++ b/library/cpp/actors/cppcoro/task_result.h @@ -67,7 +67,7 @@ namespace NActors { typename NDetail::TLValue<T>::TType Value() & { switch (Result.index()) { case 0: { - Y_FAIL("Task result has no value"); + Y_ABORT("Task result has no value"); } case 1: { if constexpr (std::same_as<T, void>) { @@ -82,13 +82,13 @@ namespace NActors { std::rethrow_exception(e); } } - Y_FAIL("Task result has an invalid state"); + Y_ABORT("Task result has an invalid state"); } typename NDetail::TRValue<T>::TType Value() && { switch (Result.index()) { case 0: { - Y_FAIL("Task result has no value"); + Y_ABORT("Task result has no value"); } case 1: { if constexpr (std::same_as<T, void>) { @@ -103,7 +103,7 @@ namespace NActors { std::rethrow_exception(std::move(e)); } } - Y_FAIL("Task result has an invalid state"); + Y_ABORT("Task result has an invalid state"); } private: diff --git a/library/cpp/actors/dnscachelib/dnscache.cpp b/library/cpp/actors/dnscachelib/dnscache.cpp index c24888caa5..91ed284c12 100644 --- a/library/cpp/actors/dnscachelib/dnscache.cpp +++ b/library/cpp/actors/dnscachelib/dnscache.cpp @@ -387,7 +387,7 @@ void TDnsCache::GHBNCallback(void* arg, int status, int, struct hostent* info) { p->second.AddrsV6.push_back(*(struct in6_addr*)(info->h_addr_list[i])); } } else { - Y_FAIL("unknown address type in ares callback"); + Y_ABORT("unknown address type in ares callback"); } resolved = TTimeKeeper::GetTime(); notfound = 0; diff --git a/library/cpp/actors/dnsresolver/dnsresolver.cpp b/library/cpp/actors/dnsresolver/dnsresolver.cpp index bf88d7a41c..d7d8c0e3b6 100644 --- a/library/cpp/actors/dnsresolver/dnsresolver.cpp +++ b/library/cpp/actors/dnsresolver/dnsresolver.cpp @@ -91,7 +91,7 @@ namespace NDnsResolver { if (WSAGetLastError() == WSAEWOULDBLOCK) { break; } - Y_FAIL("Unexpected recv error"); + Y_ABORT("Unexpected recv error"); #else if (errno == EAGAIN || errno == EWOULDBLOCK) { break; @@ -320,7 +320,7 @@ namespace NDnsResolver { break; } default: - Y_FAIL("unknown address family in ares callback"); + Y_ABORT("unknown address family in ares callback"); } } } else { @@ -349,7 +349,7 @@ namespace NDnsResolver { break; } default: - Y_FAIL("unknown address family in ares callback"); + Y_ABORT("unknown address family in ares callback"); } } else { result->ErrorText = ares_strerror(status); diff --git a/library/cpp/actors/dnsresolver/dnsresolver_caching.cpp b/library/cpp/actors/dnsresolver/dnsresolver_caching.cpp index bc3e5c3d7e..83b1847962 100644 --- a/library/cpp/actors/dnsresolver/dnsresolver_caching.cpp +++ b/library/cpp/actors/dnsresolver/dnsresolver_caching.cpp @@ -58,7 +58,7 @@ namespace NDnsResolver { case AF_UNSPEC: return OutgoingInFlightUnspec; default: - Y_FAIL("Unexpected family %d", family); + Y_ABORT("Unexpected family %d", family); } } @@ -71,7 +71,7 @@ namespace NDnsResolver { case AF_UNSPEC: return OutgoingErrorsUnspec; default: - Y_FAIL("Unexpected family %d", family); + Y_ABORT("Unexpected family %d", family); } } @@ -84,7 +84,7 @@ namespace NDnsResolver { case AF_UNSPEC: return OutgoingTotalUnspec; default: - Y_FAIL("Unexpected family %d", family); + Y_ABORT("Unexpected family %d", family); } } }; @@ -153,7 +153,7 @@ namespace NDnsResolver { break; default: - Y_FAIL("Unexpected request family %d", waitingInfo.Family); + Y_ABORT("Unexpected request family %d", waitingInfo.Family); } } @@ -173,14 +173,14 @@ namespace NDnsResolver { break; default: - Y_FAIL("Unexpected request family %d", waitingInfo.Family); + Y_ABORT("Unexpected request family %d", waitingInfo.Family); } break; } default: - Y_FAIL("Unexpected TEvUndelievered, type=%" PRIu32, ev->Get()->SourceType); + Y_ABORT("Unexpected TEvUndelievered, type=%" PRIu32, ev->Get()->SourceType); } } @@ -329,7 +329,7 @@ namespace NDnsResolver { case AF_INET: return StateIPv4; default: - Y_FAIL("Unsupported family %d", family); + Y_ABORT("Unsupported family %d", family); } } @@ -342,7 +342,7 @@ namespace NDnsResolver { case AF_INET: return StateIPv4; default: - Y_FAIL("Unsupported family %d", family); + Y_ABORT("Unsupported family %d", family); } } }; @@ -456,7 +456,7 @@ namespace NDnsResolver { PushSoftV4(it, newDeadline); break; default: - Y_FAIL("Unexpected family %d", family); + Y_ABORT("Unexpected family %d", family); } } @@ -472,7 +472,7 @@ namespace NDnsResolver { PushHardV4(it, newDeadline); break; default: - Y_FAIL("Unexpected family %d", family); + Y_ABORT("Unexpected family %d", family); } } @@ -638,7 +638,7 @@ namespace NDnsResolver { } else if (!addrs4.empty()) { reply->Addr = addrs4.front(); } else { - Y_FAIL("Unexpected reply with empty address list"); + Y_ABORT("Unexpected reply with empty address list"); } Send(req->Sender, reply.Release(), 0, req->Cookie); break; diff --git a/library/cpp/actors/helpers/selfping_actor.cpp b/library/cpp/actors/helpers/selfping_actor.cpp index 0ab1dc57e4..f9f7c297fc 100644 --- a/library/cpp/actors/helpers/selfping_actor.cpp +++ b/library/cpp/actors/helpers/selfping_actor.cpp @@ -153,7 +153,7 @@ public: switch (ev->GetTypeRewrite()) { HFunc(TEvPing, HandlePing); default: - Y_FAIL("TSelfPingActor::RunningState: unexpected event 0x%08" PRIx32, ev->GetTypeRewrite()); + Y_ABORT("TSelfPingActor::RunningState: unexpected event 0x%08" PRIx32, ev->GetTypeRewrite()); } } diff --git a/library/cpp/actors/http/http.cpp b/library/cpp/actors/http/http.cpp index 22d5409343..9da46e412b 100644 --- a/library/cpp/actors/http/http.cpp +++ b/library/cpp/actors/http/http.cpp @@ -14,7 +14,7 @@ inline TStringBuf operator +(TStringBuf l, TStringBuf r) { if (r.end() == l.begin()) { return TStringBuf(r.data(), l.size() + r.size()); } - Y_FAIL("oops"); + Y_ABORT("oops"); return TStringBuf(); } @@ -203,7 +203,7 @@ void THttpParser<THttpRequest, TSocketBuffer>::Advance(size_t len) { break; } default: - Y_FAIL("Invalid processing sequence"); + Y_ABORT("Invalid processing sequence"); break; } } @@ -590,10 +590,10 @@ THttpOutgoingRequest::THttpOutgoingRequest(TStringBuf method, TStringBuf scheme, THttpOutgoingRequest::THttpOutgoingRequest(TStringBuf method, TStringBuf url, TStringBuf protocol, TStringBuf version) { TStringBuf scheme, host, uri; if (!CrackURL(url, scheme, host, uri)) { - Y_FAIL("Invalid URL specified"); + Y_ABORT("Invalid URL specified"); } if (!scheme.empty() && scheme != "http" && scheme != "https") { - Y_FAIL("Invalid URL specified"); + Y_ABORT("Invalid URL specified"); } Secure = (scheme == "https"); TString urie = UrlEscapeRet(uri); diff --git a/library/cpp/actors/http/http_proxy.cpp b/library/cpp/actors/http/http_proxy.cpp index ea7792ef81..74bf497632 100644 --- a/library/cpp/actors/http/http_proxy.cpp +++ b/library/cpp/actors/http/http_proxy.cpp @@ -87,13 +87,13 @@ protected: void Handle(TEvHttpProxy::TEvHttpIncomingResponse::TPtr event, const NActors::TActorContext& ctx) { Y_UNUSED(event); Y_UNUSED(ctx); - Y_FAIL("This event shouldn't be there, it should go to the http connection owner directly"); + Y_ABORT("This event shouldn't be there, it should go to the http connection owner directly"); } void Handle(TEvHttpProxy::TEvHttpOutgoingResponse::TPtr event, const NActors::TActorContext& ctx) { Y_UNUSED(event); Y_UNUSED(ctx); - Y_FAIL("This event shouldn't be there, it should go to the http connection directly"); + Y_ABORT("This event shouldn't be there, it should go to the http connection directly"); } void Handle(TEvHttpProxy::TEvHttpOutgoingRequest::TPtr event, const NActors::TActorContext& ctx) { diff --git a/library/cpp/actors/interconnect/handshake_broker.h b/library/cpp/actors/interconnect/handshake_broker.h index d657e7dd51..c850320bd2 100644 --- a/library/cpp/actors/interconnect/handshake_broker.h +++ b/library/cpp/actors/interconnect/handshake_broker.h @@ -73,7 +73,7 @@ namespace NActors { } default: - Y_FAIL("Unimplimented selection strategy"); + Y_ABORT("Unimplimented selection strategy"); } const size_t n = WaiterLookup.erase(waiter); @@ -136,7 +136,7 @@ namespace NActors { hFunc(TEvHandshakeBrokerFree, Handle); default: - Y_FAIL("unexpected event 0x%08" PRIx32, ev->GetTypeRewrite()); + Y_ABORT("unexpected event 0x%08" PRIx32, ev->GetTypeRewrite()); } } diff --git a/library/cpp/actors/interconnect/interconnect_channel.cpp b/library/cpp/actors/interconnect/interconnect_channel.cpp index 30f384786b..71f4d6e5c3 100644 --- a/library/cpp/actors/interconnect/interconnect_channel.cpp +++ b/library/cpp/actors/interconnect/interconnect_channel.cpp @@ -221,7 +221,7 @@ namespace NActors { } complete = !Iter.Valid(); } else { - Y_FAIL(); + Y_ABORT(); } Y_ABORT_UNLESS(!complete || event.EventActuallySerialized == event.EventSerializedSize, "EventActuallySerialized# %" PRIu32 " EventSerializedSize# %" PRIu32 " Type# 0x%08" PRIx32, diff --git a/library/cpp/actors/interconnect/interconnect_handshake.cpp b/library/cpp/actors/interconnect/interconnect_handshake.cpp index 7783de1f92..eae80d8c5c 100644 --- a/library/cpp/actors/interconnect/interconnect_handshake.cpp +++ b/library/cpp/actors/interconnect/interconnect_handshake.cpp @@ -296,7 +296,7 @@ namespace NActors { } catch (const TExPoison&) { // just stop execution, do nothing } catch (...) { - Y_FAIL("unhandled exception"); + Y_ABORT("unhandled exception"); } if (SubscribedForConnection) { SendToProxy(MakeHolder<TEvSubscribeForConnection>(*HandshakeId, false)); @@ -439,7 +439,7 @@ namespace NActors { throw TExPoison(); default: - Y_FAIL("unexpected event 0x%08" PRIx32, type); + Y_ABORT("unexpected event 0x%08" PRIx32, type); } } @@ -1097,7 +1097,7 @@ namespace NActors { SendExBlock(MainChannel, ev->Record, "ExReply"); ProgramInfo.Clear(); // do not issue reply to the proxy } else { - Y_FAIL("unexpected event Type# 0x%08" PRIx32, reply->GetTypeRewrite()); + Y_ABORT("unexpected event Type# 0x%08" PRIx32, reply->GetTypeRewrite()); } } } diff --git a/library/cpp/actors/interconnect/interconnect_resolve.cpp b/library/cpp/actors/interconnect/interconnect_resolve.cpp index 921f08fba6..071af2f7c4 100644 --- a/library/cpp/actors/interconnect/interconnect_resolve.cpp +++ b/library/cpp/actors/interconnect/interconnect_resolve.cpp @@ -157,7 +157,7 @@ namespace NActors { return MakeHolder<NAddr::TIPv4Addr>(TIpAddress(msg->GetAddrV4().s_addr, Port)); } - Y_FAIL("Unexpected result address family"); + Y_ABORT("Unexpected result address family"); } return nullptr; diff --git a/library/cpp/actors/interconnect/interconnect_stream.cpp b/library/cpp/actors/interconnect/interconnect_stream.cpp index 51a23923af..ab3b74fa57 100644 --- a/library/cpp/actors/interconnect/interconnect_stream.cpp +++ b/library/cpp/actors/interconnect/interconnect_stream.cpp @@ -50,13 +50,13 @@ namespace NInterconnect { return; switch (LastSocketError()) { case EBADF: - Y_FAIL("Close bad descriptor"); + Y_ABORT("Close bad descriptor"); case EINTR: break; case EIO: - Y_FAIL("EIO"); + Y_ABORT("EIO"); default: - Y_FAIL("It's something unexpected"); + Y_ABORT("It's something unexpected"); } } @@ -136,7 +136,7 @@ namespace NInterconnect { return -LastSocketError(); return ret; #else - Y_FAIL("WriteV() unsupported on Windows"); + Y_ABORT("WriteV() unsupported on Windows"); #endif } @@ -148,7 +148,7 @@ namespace NInterconnect { return -LastSocketError(); return ret; #else - Y_FAIL("ReadV() unsupported on Windows"); + Y_ABORT("ReadV() unsupported on Windows"); #endif } @@ -481,7 +481,7 @@ namespace NInterconnect { } } } - Y_FAIL(); + Y_ABORT(); } std::optional<std::pair<const void*, size_t>> BlockedSend; @@ -585,7 +585,7 @@ namespace NInterconnect { return -EPROTO; default: - Y_FAIL("unexpected SSL_get_error() status# %d", status); + Y_ABORT("unexpected SSL_get_error() status# %d", status); } } }; @@ -616,11 +616,11 @@ namespace NInterconnect { } ssize_t TSecureSocket::WriteV(const struct iovec* /*iov*/, int /*iovcnt*/) const { - Y_FAIL("unsupported on SSL sockets"); + Y_ABORT("unsupported on SSL sockets"); } ssize_t TSecureSocket::ReadV(const struct iovec* /*iov*/, int /*iovcnt*/) const { - Y_FAIL("unsupported on SSL sockets"); + Y_ABORT("unsupported on SSL sockets"); } TString TSecureSocket::GetCipherName() const { diff --git a/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp index 5e29f49590..3f5ebd2987 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp @@ -307,7 +307,7 @@ namespace NActors { break; default: - Y_FAIL("unexpected state"); + Y_ABORT("unexpected state"); } break; } diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp index c1994b2d71..514bfb0b84 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp @@ -525,7 +525,7 @@ namespace NActors { break; default: - Y_FAIL("Unexpected type of event in held event queue"); + Y_ABORT("Unexpected type of event in held event queue"); } } @@ -736,7 +736,7 @@ namespace NActors { switch (auto& ev = h; ev->GetTypeRewrite()) { hFunc(NMon::TEvHttpInfoRes, Session->GenerateHttpInfo); default: - Y_FAIL(); + Y_ABORT(); } } else { TActivationContext::Send(h.Release()); diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h index 4622bf3f88..81f043a2e9 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h +++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h @@ -129,7 +129,7 @@ namespace NActors { hFunc(TEvSubscribeForConnection, Handle); \ hFunc(TEvReportConnection, Handle); \ default: \ - Y_FAIL("unexpected event Type# 0x%08" PRIx32, type); \ + Y_ABORT("unexpected event Type# 0x%08" PRIx32, type); \ } \ } \ if (profiled) { \ @@ -316,7 +316,7 @@ namespace NActors { hFunc(TEvHandshakeAsk, IncomingHandshake); hFunc(TEvHandshakeRequest, IncomingHandshake); default: - Y_FAIL(); + Y_ABORT(); } } void IncomingHandshake(TEvHandshakeAsk::TPtr& ev); diff --git a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp index 59738b2052..a7509fbc94 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp @@ -112,7 +112,7 @@ namespace NActors { } void TInterconnectSessionTCP::PassAway() { - Y_FAIL("TInterconnectSessionTCP::PassAway() can't be called directly"); + Y_ABORT("TInterconnectSessionTCP::PassAway() can't be called directly"); } void TInterconnectSessionTCP::Forward(STATEFN_SIG) { @@ -326,7 +326,7 @@ namespace NActors { switch (EUpdateState state = ReceiveContext->UpdateState) { case EUpdateState::NONE: case EUpdateState::CONFIRMING: - Y_FAIL("unexpected state"); + Y_ABORT("unexpected state"); case EUpdateState::INFLIGHT: // this message we are processing was the only one in flight, so we can reset state to NONE here diff --git a/library/cpp/actors/interconnect/mock/ic_mock.cpp b/library/cpp/actors/interconnect/mock/ic_mock.cpp index 9178e52da8..81e181b673 100644 --- a/library/cpp/actors/interconnect/mock/ic_mock.cpp +++ b/library/cpp/actors/interconnect/mock/ic_mock.cpp @@ -89,7 +89,7 @@ namespace NActors { } else if (nodeId == ui32(Key >> 32)) { return PeerInfo + 1; } else { - Y_FAIL(); + Y_ABORT(); } } }; @@ -236,7 +236,7 @@ namespace NActors { break; default: - Y_FAIL(); + Y_ABORT(); } } } diff --git a/library/cpp/actors/interconnect/outgoing_stream.h b/library/cpp/actors/interconnect/outgoing_stream.h index 47803764d7..980bd401f0 100644 --- a/library/cpp/actors/interconnect/outgoing_stream.h +++ b/library/cpp/actors/interconnect/outgoing_stream.h @@ -100,7 +100,7 @@ namespace NInterconnect { const char *bufferBegin = buffer->Data; const char *bufferEnd = bufferBegin + BufferSize; if (bufferBegin < end && begin < bufferEnd) { - Y_FAIL(); + Y_ABORT(); } } #endif diff --git a/library/cpp/actors/interconnect/poller_actor.cpp b/library/cpp/actors/interconnect/poller_actor.cpp index e3ddbe8b98..1f18e72a5b 100644 --- a/library/cpp/actors/interconnect/poller_actor.cpp +++ b/library/cpp/actors/interconnect/poller_actor.cpp @@ -89,7 +89,7 @@ namespace NActors { try { TPipeHandle::Pipe(ReadEnd, WriteEnd, CloseOnExec); } catch (const TFileError& err) { - Y_FAIL("failed to create pipe"); + Y_ABORT("failed to create pipe"); } // switch the read/write ends to nonblocking mode @@ -134,7 +134,7 @@ namespace NActors { if (err == EINTR) { continue; } else { - Y_FAIL("WriteEnd.Write() failed with %s", strerror(err)); + Y_ABORT("WriteEnd.Write() failed with %s", strerror(err)); } } else { Y_ABORT_UNLESS(nwritten); @@ -157,7 +157,7 @@ namespace NActors { } else if (error == EAGAIN || error == EWOULDBLOCK) { break; } else { - Y_FAIL("read() failed with %s", strerror(errno)); + Y_ABORT("read() failed with %s", strerror(errno)); } } else { Y_ABORT_UNLESS(n); @@ -178,7 +178,7 @@ namespace NActors { } else if (std::get_if<TPollerWakeup>(&op->Operation)) { op->SignalDone(); } else { - Y_FAIL(); + Y_ABORT(); } } while (SyncOperationsQ.Pop()); return true; diff --git a/library/cpp/actors/interconnect/poller_actor_darwin.h b/library/cpp/actors/interconnect/poller_actor_darwin.h index f091972502..a1f750e711 100644 --- a/library/cpp/actors/interconnect/poller_actor_darwin.h +++ b/library/cpp/actors/interconnect/poller_actor_darwin.h @@ -53,7 +53,7 @@ namespace NActors { if (errno == EINTR) { return false; } else { - Y_FAIL("kevent() failed with %s", strerror(errno)); + Y_ABORT("kevent() failed with %s", strerror(errno)); } } diff --git a/library/cpp/actors/interconnect/poller_actor_linux.h b/library/cpp/actors/interconnect/poller_actor_linux.h index f19f53f730..8831d2062b 100644 --- a/library/cpp/actors/interconnect/poller_actor_linux.h +++ b/library/cpp/actors/interconnect/poller_actor_linux.h @@ -19,7 +19,7 @@ namespace NActors { event.data.ptr = nullptr; event.events = EPOLLIN; if (epoll_ctl(EpollDescriptor, EPOLL_CTL_ADD, ReadEnd, &event) == -1) { - Y_FAIL("epoll_ctl(EPOLL_CTL_ADD) failed with %s", strerror(errno)); + Y_ABORT("epoll_ctl(EPOLL_CTL_ADD) failed with %s", strerror(errno)); } ISimpleThread::Start(); // start poller thread @@ -44,7 +44,7 @@ namespace NActors { if (errno == EINTR) { return false; // restart the call a bit later } else { - Y_FAIL("epoll_wait() failed with %s", strerror(errno)); + Y_ABORT("epoll_wait() failed with %s", strerror(errno)); } } @@ -69,7 +69,7 @@ namespace NActors { event.events = EPOLLONESHOT | EPOLLRDHUP | flags; event.data.ptr = record; if (epoll_ctl(EpollDescriptor, EPOLL_CTL_MOD, record->Socket->GetDescriptor(), &event) == -1) { - Y_FAIL("epoll_ctl(EPOLL_CTL_MOD) failed with %s", strerror(errno)); + Y_ABORT("epoll_ctl(EPOLL_CTL_MOD) failed with %s", strerror(errno)); } } @@ -85,7 +85,7 @@ namespace NActors { void UnregisterSocketInLoop(const TIntrusivePtr<TSharedDescriptor>& socket) { if (epoll_ctl(EpollDescriptor, EPOLL_CTL_DEL, socket->GetDescriptor(), nullptr) == -1) { - Y_FAIL("epoll_ctl(EPOLL_CTL_DEL) failed with %s", strerror(errno)); + Y_ABORT("epoll_ctl(EPOLL_CTL_DEL) failed with %s", strerror(errno)); } } @@ -94,7 +94,7 @@ namespace NActors { event.events = EPOLLONESHOT | EPOLLRDHUP; event.data.ptr = record.Get(); if (epoll_ctl(EpollDescriptor, EPOLL_CTL_ADD, record->Socket->GetDescriptor(), &event) == -1) { - Y_FAIL("epoll_ctl(EPOLL_CTL_ADD) failed with %s", strerror(errno)); + Y_ABORT("epoll_ctl(EPOLL_CTL_ADD) failed with %s", strerror(errno)); } } @@ -109,7 +109,7 @@ namespace NActors { event.events = EPOLLONESHOT | EPOLLRDHUP | flags; event.data.ptr = record.Get(); if (epoll_ctl(EpollDescriptor, EPOLL_CTL_MOD, record->Socket->GetDescriptor(), &event) == -1) { - Y_FAIL("epoll_ctl(EPOLL_CTL_MOD) failed with %s", strerror(errno)); + Y_ABORT("epoll_ctl(EPOLL_CTL_MOD) failed with %s", strerror(errno)); } } } diff --git a/library/cpp/actors/interconnect/poller_actor_win.h b/library/cpp/actors/interconnect/poller_actor_win.h index 9666c32be7..f59d3ddda7 100644 --- a/library/cpp/actors/interconnect/poller_actor_win.h +++ b/library/cpp/actors/interconnect/poller_actor_win.h @@ -53,7 +53,7 @@ namespace NActors { if (err == EINTR) { return false; // try a bit later } else { - Y_FAIL("select() failed with %s", strerror(err)); + Y_ABORT("select() failed with %s", strerror(err)); } } diff --git a/library/cpp/actors/interconnect/poller_tcp_unit.cpp b/library/cpp/actors/interconnect/poller_tcp_unit.cpp index 853fce04b4..994d907004 100644 --- a/library/cpp/actors/interconnect/poller_tcp_unit.cpp +++ b/library/cpp/actors/interconnect/poller_tcp_unit.cpp @@ -120,7 +120,7 @@ namespace NInterconnect { do { auto sock = InputQueue.Top().first->GetDescriptor(); if (!Operations.emplace(sock, std::move(InputQueue.Top())).second) - Y_FAIL("Descriptor is already in pooler."); + Y_ABORT("Descriptor is already in pooler."); } while (InputQueue.Pop()); } } diff --git a/library/cpp/actors/interconnect/poller_tcp_unit_epoll.cpp b/library/cpp/actors/interconnect/poller_tcp_unit_epoll.cpp index 33666a2747..aac6d52bb4 100644 --- a/library/cpp/actors/interconnect/poller_tcp_unit_epoll.cpp +++ b/library/cpp/actors/interconnect/poller_tcp_unit_epoll.cpp @@ -13,7 +13,7 @@ namespace NInterconnect { ::epoll_event event = {0, {.fd = stream}}; if (::epoll_ctl(epoll, EPOLL_CTL_DEL, stream, &event)) { Cerr << "epoll_ctl errno: " << errno << Endl; - Y_FAIL("epoll delete error!"); + Y_ABORT("epoll delete error!"); } } @@ -24,7 +24,7 @@ namespace NInterconnect { event.data.fd = stream; if (::epoll_ctl(epoll, EPOLL_CTL_ADD, stream, &event)) { Cerr << "epoll_ctl errno: " << errno << Endl; - Y_FAIL("epoll add error!"); + Y_ABORT("epoll add error!"); } } @@ -92,7 +92,7 @@ namespace NInterconnect { ::epoll_pwait(epoll, events, EVENTS_BUF_SIZE, 200, &sigmask); if (result == -1 && errno != EINTR) - Y_FAIL("epoll wait error!"); + Y_ABORT("epoll wait error!"); auto& side = GetSide<WriteOp>(); side.ProcessInput(); diff --git a/library/cpp/actors/interconnect/ut/interconnect_ut.cpp b/library/cpp/actors/interconnect/ut/interconnect_ut.cpp index 8d1b47c0c6..bc9e86545a 100644 --- a/library/cpp/actors/interconnect/ut/interconnect_ut.cpp +++ b/library/cpp/actors/interconnect/ut/interconnect_ut.cpp @@ -64,7 +64,7 @@ public: Y_ABORT_UNLESS(it->second == ev->GetChainBuffer()->GetString()); Tentative.erase(it); } else { - Y_FAIL("Cookie# %" PRIu64, ev->Cookie); + Y_ABORT("Cookie# %" PRIu64, ev->Cookie); } IssueQueries(); } @@ -167,7 +167,7 @@ Y_UNIT_TEST_SUITE(Interconnect) { break; default: - Y_FAIL(); + Y_ABORT(); } Sleep(TDuration::MilliSeconds(RandomNumber<ui32>(500) + 100)); diff --git a/library/cpp/actors/interconnect/ut/large.cpp b/library/cpp/actors/interconnect/ut/large.cpp index 725238242a..88207f816b 100644 --- a/library/cpp/actors/interconnect/ut/large.cpp +++ b/library/cpp/actors/interconnect/ut/large.cpp @@ -63,7 +63,7 @@ Y_UNIT_TEST_SUITE(LargeMessage) { Y_ABORT_UNLESS(SessionId != ev->InterconnectSession); Done.Signal(); } else { - Y_FAIL("incorrect sequence number"); + Y_ABORT("incorrect sequence number"); } } diff --git a/library/cpp/actors/interconnect/ut/poller_actor_ut.cpp b/library/cpp/actors/interconnect/ut/poller_actor_ut.cpp index 67921ef9bc..38b9b5a0b6 100644 --- a/library/cpp/actors/interconnect/ut/poller_actor_ut.cpp +++ b/library/cpp/actors/interconnect/ut/poller_actor_ut.cpp @@ -44,15 +44,15 @@ std::pair<TTestSocketPtr, TTestSocketPtr> TcpSockets() { addr.sin_port = 0; addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); if (bind(server, (sockaddr*)&addr, sizeof(addr)) == -1) { - Y_FAIL("bind() failed with %s", strerror(errno)); + Y_ABORT("bind() failed with %s", strerror(errno)); } else if (listen(server, 1) == -1) { - Y_FAIL("listen() failed with %s", strerror(errno)); + Y_ABORT("listen() failed with %s", strerror(errno)); } // obtain local address for client socklen_t len = sizeof(addr); if (getsockname(server, (sockaddr*)&addr, &len) == -1) { - Y_FAIL("getsockname() failed with %s", strerror(errno)); + Y_ABORT("getsockname() failed with %s", strerror(errno)); } // create client socket @@ -61,7 +61,7 @@ std::pair<TTestSocketPtr, TTestSocketPtr> TcpSockets() { // connect to server if (connect(client, (sockaddr*)&addr, len) == -1) { - Y_FAIL("connect() failed with %s", strerror(errno)); + Y_ABORT("connect() failed with %s", strerror(errno)); } // accept connection from the other side diff --git a/library/cpp/actors/testlib/test_runtime.cpp b/library/cpp/actors/testlib/test_runtime.cpp index 256116ce32..20b26c33d3 100644 --- a/library/cpp/actors/testlib/test_runtime.cpp +++ b/library/cpp/actors/testlib/test_runtime.cpp @@ -298,7 +298,7 @@ namespace NActors { ui32 GetReadyActivation(TWorkerContext& wctx, ui64 revolvingCounter) override { Y_UNUSED(wctx); Y_UNUSED(revolvingCounter); - Y_FAIL(); + Y_ABORT(); } void ReclaimMailbox(TMailboxType::EType mailboxType, ui32 hint, TWorkerId workerId, ui64 revolvingCounter) override { @@ -458,7 +458,7 @@ namespace NActors { // generic TAffinity* Affinity() const override { - Y_FAIL(); + Y_ABORT(); } private: @@ -812,7 +812,7 @@ namespace NActors { TString explanation; auto status = node->LogSettings->SetLevel(priority, component, explanation); if (status) { - Y_FAIL("SetLogPriority failed: %s", explanation.c_str()); + Y_ABORT("SetLogPriority failed: %s", explanation.c_str()); } } } @@ -956,7 +956,7 @@ namespace NActors { UnlockFromExecution((TMailboxTable::TTinyReadAsFilledMailbox *)mailbox, node->ExecutorPools[0], false, hint, MaxWorkers, ++revolvingCounter); break; default: - Y_FAIL("Unsupported mailbox type"); + Y_ABORT("Unsupported mailbox type"); } return actorId; @@ -1250,7 +1250,7 @@ namespace NActors { break; } default: - Y_FAIL("Unknown action"); + Y_ABORT("Unknown action"); } } } @@ -1753,7 +1753,7 @@ namespace NActors { for (auto& x : Nodes) { return x.second->ActorSystem.Get(); } - Y_FAIL("Don't use this method."); + Y_ABORT("Don't use this method."); } TActorSystem* TTestActorRuntimeBase::GetActorSystem(ui32 nodeId) { diff --git a/library/cpp/actors/util/rc_buf.h b/library/cpp/actors/util/rc_buf.h index b5b15fa4cc..db0f7deff5 100644 --- a/library/cpp/actors/util/rc_buf.h +++ b/library/cpp/actors/util/rc_buf.h @@ -679,7 +679,7 @@ class TRcBuf { case EType::INTERNAL_BACKEND: return wrapper(reinterpret_cast<std::conditional_t<IsConst, const TInternalBackend&, TInternalBackend&>>(value)); case EType::EXTERNAL_BACKEND: return wrapper(reinterpret_cast<std::conditional_t<IsConst, const IContiguousChunk::TPtr&, IContiguousChunk::TPtr&>>(value)); } - Y_FAIL("Unexpected type# %" PRIu64, static_cast<ui64>(type)); + Y_ABORT("Unexpected type# %" PRIu64, static_cast<ui64>(type)); } template<typename TOwner, typename TCallback, bool IsConst = std::is_const_v<TOwner>> @@ -1039,7 +1039,7 @@ public: return EResizeResult::NoAlloc; } else { if (strategy == EResizeStrategy::FailOnCopy && static_cast<bool>(Backend)) { - Y_FAIL("Fail on grow"); + Y_ABORT("Fail on grow"); } auto newData = TRcBuf::Uninitialized(size + GetSize(), UnsafeHeadroom() > size ? UnsafeHeadroom() - size : 0, UnsafeTailroom()); if (auto data = GetData(); data) { @@ -1056,7 +1056,7 @@ public: return EResizeResult::NoAlloc; } else { if (strategy == EResizeStrategy::FailOnCopy && static_cast<bool>(Backend)) { - Y_FAIL("Fail on grow"); + Y_ABORT("Fail on grow"); } auto newData = TRcBuf::Uninitialized(size + GetSize(), UnsafeHeadroom(), UnsafeTailroom() > size ? UnsafeTailroom() - size : 0); if (auto data = GetData(); data) { diff --git a/library/cpp/actors/util/rope.h b/library/cpp/actors/util/rope.h index 4487fdc87d..b092d502cd 100644 --- a/library/cpp/actors/util/rope.h +++ b/library/cpp/actors/util/rope.h @@ -39,7 +39,7 @@ public: } void *operator new(size_t) { - Y_FAIL(); + Y_ABORT(); } void *operator new(size_t, void *ptr) { diff --git a/library/cpp/codecs/greedy_dict/gd_stats.h b/library/cpp/codecs/greedy_dict/gd_stats.h index b63c4c38d2..e0e814c7ad 100644 --- a/library/cpp/codecs/greedy_dict/gd_stats.h +++ b/library/cpp/codecs/greedy_dict/gd_stats.h @@ -49,7 +49,7 @@ namespace NGreedyDict { case EST_SIMPLE_NORM: return SimpleTestNorm(modelp, countAB, total); } - Y_FAIL("no way!"); + Y_ABORT("no way!"); return 0; } @@ -72,7 +72,7 @@ namespace NGreedyDict { case ES_SOLAR: return SolarTest(modelp, count, total); } - Y_FAIL("no way!"); + Y_ABORT("no way!"); return 0; } diff --git a/library/cpp/containers/concurrent_hash/concurrent_hash.h b/library/cpp/containers/concurrent_hash/concurrent_hash.h index 2c0f68cd8c..88da30fd78 100644 --- a/library/cpp/containers/concurrent_hash/concurrent_hash.h +++ b/library/cpp/containers/concurrent_hash/concurrent_hash.h @@ -96,7 +96,7 @@ public: TBucket& bucket = GetBucketForKey(key); TGuard<TLock> guard(bucket.Mutex); if (!bucket.Map.insert(std::make_pair(key, value)).second) { - Y_FAIL("non-unique key"); + Y_ABORT("non-unique key"); } } diff --git a/library/cpp/containers/stack_vector/stack_vec.h b/library/cpp/containers/stack_vector/stack_vec.h index 25a8658fd3..b6036059b2 100644 --- a/library/cpp/containers/stack_vector/stack_vec.h +++ b/library/cpp/containers/stack_vector/stack_vec.h @@ -64,7 +64,7 @@ namespace NPrivate { return reinterpret_cast<T*>(&StackBasedStorage[0]); } else { if constexpr (!UseFallbackAlloc) { - Y_FAIL( + Y_ABORT( "Stack storage overflow. Capacity: %d, requested: %d", (int)CountOnStack, int(n)); } return FallbackAllocator().allocate(n); diff --git a/library/cpp/coroutine/engine/impl.cpp b/library/cpp/coroutine/engine/impl.cpp index 5f2e4a53f6..c999fe0e10 100644 --- a/library/cpp/coroutine/engine/impl.cpp +++ b/library/cpp/coroutine/engine/impl.cpp @@ -357,7 +357,7 @@ void TContExecutor::RunScheduler() noexcept { } } catch (...) { TBackTrace::FromCurrentException().PrintTo(Cerr); - Y_FAIL("Uncaught exception in the scheduler: %s", CurrentExceptionMessage().c_str()); + Y_ABORT("Uncaught exception in the scheduler: %s", CurrentExceptionMessage().c_str()); } } @@ -372,7 +372,7 @@ void TContExecutor::Pause() { void TContExecutor::Exit(TCont* cont) noexcept { ScheduleToDelete(cont); cont->SwitchTo(&SchedContext_); - Y_FAIL("can not return from exit"); + Y_ABORT("can not return from exit"); } TInstant TContExecutor::Now() { diff --git a/library/cpp/coroutine/engine/poller.cpp b/library/cpp/coroutine/engine/poller.cpp index bcd31d209c..4669828a07 100644 --- a/library/cpp/coroutine/engine/poller.cpp +++ b/library/cpp/coroutine/engine/poller.cpp @@ -355,6 +355,6 @@ THolder<IPollerFace> IPollerFace::Construct(EContPoller poller) { return nullptr; #endif default: - Y_FAIL("bad poller type"); + Y_ABORT("bad poller type"); } } diff --git a/library/cpp/getopt/small/completer.cpp b/library/cpp/getopt/small/completer.cpp index f9a14b8234..43ceabe25b 100644 --- a/library/cpp/getopt/small/completer.cpp +++ b/library/cpp/getopt/small/completer.cpp @@ -122,7 +122,7 @@ namespace NLastGetopt::NComp { } void GenerateZsh(TFormattedOutput&, TCompleterManager&) const override { - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); } private: diff --git a/library/cpp/grpc/client/grpc_client_low.cpp b/library/cpp/grpc/client/grpc_client_low.cpp index d06bbb2a7d..0e8b97f256 100644 --- a/library/cpp/grpc/client/grpc_client_low.cpp +++ b/library/cpp/grpc/client/grpc_client_low.cpp @@ -568,7 +568,7 @@ void TGRpcClientLow::ForgetContext(TContextImpl* context) { std::unique_lock<std::mutex> guard(Mtx_); if (!Contexts_.erase(context)) { - Y_FAIL("Unexpected ForgetContext(%p)", context); + Y_ABORT("Unexpected ForgetContext(%p)", context); } if (Contexts_.empty()) { diff --git a/library/cpp/http/simple/http_client.h b/library/cpp/http/simple/http_client.h index 94ee487202..c01b11ba43 100644 --- a/library/cpp/http/simple/http_client.h +++ b/library/cpp/http/simple/http_client.h @@ -271,6 +271,6 @@ TKeepAliveHttpClient::THttpCode TKeepAliveHttpClient::DoRequestReliable(const T& throw; } } - Y_FAIL(); // We should never be here. + Y_ABORT(); // We should never be here. return 0; } diff --git a/library/cpp/logger/backend.cpp b/library/cpp/logger/backend.cpp index 77211c9655..df23067f17 100644 --- a/library/cpp/logger/backend.cpp +++ b/library/cpp/logger/backend.cpp @@ -24,7 +24,7 @@ namespace { return; } } - Y_FAIL("Incorrect pointer for log backend"); + Y_ABORT("Incorrect pointer for log backend"); } void Reopen(bool flush) { diff --git a/library/cpp/logger/global/global.cpp b/library/cpp/logger/global/global.cpp index 9fbd10f666..4d4e6aeb37 100644 --- a/library/cpp/logger/global/global.cpp +++ b/library/cpp/logger/global/global.cpp @@ -39,5 +39,5 @@ TNullLog* CreateDefaultLogger<TNullLog>() { NPrivateGlobalLogger::TVerifyEvent::~TVerifyEvent() { const TString info = Str(); FATAL_LOG << info << Endl; - Y_FAIL("%s", info.data()); + Y_ABORT("%s", info.data()); } diff --git a/library/cpp/lwtrace/mon/mon_lwtrace.cpp b/library/cpp/lwtrace/mon/mon_lwtrace.cpp index 5e79716834..6642b07098 100644 --- a/library/cpp/lwtrace/mon/mon_lwtrace.cpp +++ b/library/cpp/lwtrace/mon/mon_lwtrace.cpp @@ -225,9 +225,9 @@ private: } else { return false; // param not found } - case TrackDuration: Y_FAIL(); - case TrackBeginTime: Y_FAIL(); - case TrackEndTime: Y_FAIL(); + case TrackDuration: Y_ABORT(); + case TrackBeginTime: Y_ABORT(); + case TrackEndTime: Y_ABORT(); case ElapsedDuration: break; case SliceDuration: break; case ThreadTime: break; @@ -240,9 +240,9 @@ private: case NotSpecial: Result = NLWTrace::TTypedParam(Item->GetParam(Query.ParamName)); return true; - case TrackDuration: Y_FAIL(); - case TrackBeginTime: Y_FAIL(); - case TrackEndTime: Y_FAIL(); + case TrackDuration: Y_ABORT(); + case TrackBeginTime: Y_ABORT(); + case TrackEndTime: Y_ABORT(); case ElapsedDuration: Result = NLWTrace::TTypedParam(Query.Duration( Log->GetTimestampCycles(), diff --git a/library/cpp/lwtrace/signature.h b/library/cpp/lwtrace/signature.h index 868bd9bcf2..2c68aa40bf 100644 --- a/library/cpp/lwtrace/signature.h +++ b/library/cpp/lwtrace/signature.h @@ -139,7 +139,7 @@ namespace NLWTrace { case PT_UNKNOWN: return; default: - Y_FAIL("unknown param type"); + Y_ABORT("unknown param type"); } } @@ -180,7 +180,7 @@ namespace NLWTrace { case PT_UNKNOWN: return; default: - Y_FAIL("unknown param type"); + Y_ABORT("unknown param type"); } } @@ -205,7 +205,7 @@ namespace NLWTrace { case PT_UNKNOWN: return; default: - Y_FAIL("unknown param type"); + Y_ABORT("unknown param type"); } } @@ -224,7 +224,7 @@ namespace NLWTrace { case PT_UNKNOWN: return; default: - Y_FAIL("unknown param type"); + Y_ABORT("unknown param type"); } Type = PT_UNKNOWN; } @@ -240,7 +240,7 @@ namespace NLWTrace { case PT_UNKNOWN: return false; // All unknowns are equal default: - Y_FAIL("unknown param type"); + Y_ABORT("unknown param type"); } } else { return false; @@ -261,7 +261,7 @@ namespace NLWTrace { case PT_UNKNOWN: return false; // All unknowns are equal default: - Y_FAIL("unknown param type"); + Y_ABORT("unknown param type"); } } else { return Type < rhs.Type; @@ -279,7 +279,7 @@ namespace NLWTrace { case PT_UNKNOWN: return true; // All unknowns are equal default: - Y_FAIL("unknown param type"); + Y_ABORT("unknown param type"); } } else { return Type < rhs.Type; diff --git a/library/cpp/malloc/nalf/alloc_helpers.h b/library/cpp/malloc/nalf/alloc_helpers.h index 0e3649d76a..c98c05d998 100644 --- a/library/cpp/malloc/nalf/alloc_helpers.h +++ b/library/cpp/malloc/nalf/alloc_helpers.h @@ -9,17 +9,17 @@ struct TNoHeapAlloc { // implemented and available for gcc virtual destructors protected: void operator delete(void*) { - Y_FAIL(); + Y_ABORT(); } void operator delete[](void*) { - Y_FAIL(); + Y_ABORT(); } void operator delete(void*, const std::nothrow_t&) { - Y_FAIL(); + Y_ABORT(); } void operator delete[](void*, const std::nothrow_t&) { - Y_FAIL(); + Y_ABORT(); } }; diff --git a/library/cpp/messagebus/actor/tasks.h b/library/cpp/messagebus/actor/tasks.h index 5e1fd5f212..ba4bc3050b 100644 --- a/library/cpp/messagebus/actor/tasks.h +++ b/library/cpp/messagebus/actor/tasks.h @@ -41,7 +41,7 @@ namespace NActor { } else if (newState == E_WAITING) { return false; } - Y_FAIL("unknown"); + Y_ABORT("unknown"); } }; diff --git a/library/cpp/messagebus/config/netaddr.cpp b/library/cpp/messagebus/config/netaddr.cpp index 4660711a0c..0e9f76be8c 100644 --- a/library/cpp/messagebus/config/netaddr.cpp +++ b/library/cpp/messagebus/config/netaddr.cpp @@ -14,7 +14,7 @@ namespace NBus { case EIP_VERSION_6: return "EIP_VERSION_6"; } - Y_FAIL(); + Y_ABORT(); } int ToAddrFamily(EIpVersion ipVersion) { @@ -26,7 +26,7 @@ namespace NBus { case EIP_VERSION_6: return AF_INET6; } - Y_FAIL(); + Y_ABORT(); } class TNetworkAddressRef: private TNetworkAddress, public TAddrInfo { @@ -81,7 +81,7 @@ namespace NBus { case EIP_VERSION_ANY: return "any address"; default: - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); } } @@ -158,7 +158,7 @@ namespace NBus { case AF_INET6: return InetToHost(((sockaddr_in6*)Ptr->Addr())->sin6_port); default: - Y_FAIL("unknown AF: %d", (int)Ptr->Addr()->sa_family); + Y_ABORT("unknown AF: %d", (int)Ptr->Addr()->sa_family); throw 1; } } diff --git a/library/cpp/messagebus/debug_receiver/debug_receiver_proto.cpp b/library/cpp/messagebus/debug_receiver/debug_receiver_proto.cpp index 0c74f9ecc3..008084d345 100644 --- a/library/cpp/messagebus/debug_receiver/debug_receiver_proto.cpp +++ b/library/cpp/messagebus/debug_receiver/debug_receiver_proto.cpp @@ -8,7 +8,7 @@ TDebugReceiverProtocol::TDebugReceiverProtocol() } void TDebugReceiverProtocol::Serialize(const NBus::TBusMessage*, TBuffer&) { - Y_FAIL("it is receiver only"); + Y_ABORT("it is receiver only"); } TAutoPtr<NBus::TBusMessage> TDebugReceiverProtocol::Deserialize(ui16, TArrayRef<const char> payload) { diff --git a/library/cpp/messagebus/event_loop.cpp b/library/cpp/messagebus/event_loop.cpp index 9a9d90508d..ffb31d0c9b 100644 --- a/library/cpp/messagebus/event_loop.cpp +++ b/library/cpp/messagebus/event_loop.cpp @@ -262,7 +262,7 @@ TEventLoop::TImpl::TImpl(const char* name) SOCKET wakeupSockets[2]; if (SocketPair(wakeupSockets) < 0) { - Y_FAIL("failed to create socket pair for wakeup sockets: %s", LastSystemErrorText()); + Y_ABORT("failed to create socket pair for wakeup sockets: %s", LastSystemErrorText()); } TSocketHolder wakeupReadSocket(wakeupSockets[0]); @@ -297,7 +297,7 @@ void TEventLoop::TImpl::Run() { if (*c == this) { char buf[0x1000]; if (NBus::NPrivate::SocketRecv(WakeupReadSocket, buf) < 0) { - Y_FAIL("failed to recv from wakeup socket: %s", LastSystemErrorText()); + Y_ABORT("failed to recv from wakeup socket: %s", LastSystemErrorText()); } continue; } @@ -354,7 +354,7 @@ TChannelPtr TEventLoop::TImpl::Register(TSocket socket, TEventHandlerPtr eventHa void TEventLoop::TImpl::Wakeup() { if (NBus::NPrivate::SocketSend(WakeupWriteSocket, TArrayRef<const char>("", 1)) < 0) { if (LastSystemError() != EAGAIN) { - Y_FAIL("failed to send to wakeup socket: %s", LastSystemErrorText()); + Y_ABORT("failed to send to wakeup socket: %s", LastSystemErrorText()); } } } @@ -367,6 +367,6 @@ void TEventLoop::TImpl::AddToPoller(SOCKET socket, void* cookie, int flags) { } else if (flags == OP_READ_WRITE) { Poller.WaitReadWriteOneShot(socket, cookie); } else { - Y_FAIL("Wrong flags: %d", int(flags)); + Y_ABORT("Wrong flags: %d", int(flags)); } } diff --git a/library/cpp/messagebus/locator.cpp b/library/cpp/messagebus/locator.cpp index e49716f166..5cc4604754 100644 --- a/library/cpp/messagebus/locator.cpp +++ b/library/cpp/messagebus/locator.cpp @@ -409,7 +409,7 @@ namespace NBus { return 0; } if ((item.Start < start && start < item.End) || (item.Start < end && end < item.End)) { - Y_FAIL("Overlap in registered keys with non-identical range"); + Y_ABORT("Overlap in registered keys with non-identical range"); } } diff --git a/library/cpp/messagebus/message.cpp b/library/cpp/messagebus/message.cpp index ac8caa5c56..8f8ff7e442 100644 --- a/library/cpp/messagebus/message.cpp +++ b/library/cpp/messagebus/message.cpp @@ -34,7 +34,7 @@ namespace NBus { if (!!Connection) { return Connection->GetAddr(); } else { - Y_FAIL(); + Y_ABORT(); } } @@ -112,7 +112,7 @@ namespace NBus { if (Y_UNLIKELY(LocalFlags != 0)) { TString describe = Describe(); TString localFlags = LocalFlagSetToString(LocalFlags); - Y_FAIL("message local flags must be zero, got: %s, message: %s", localFlags.data(), describe.data()); + Y_ABORT("message local flags must be zero, got: %s, message: %s", localFlags.data(), describe.data()); } } diff --git a/library/cpp/messagebus/message.h b/library/cpp/messagebus/message.h index 2027f24983..f7f58930c9 100644 --- a/library/cpp/messagebus/message.h +++ b/library/cpp/messagebus/message.h @@ -86,7 +86,7 @@ namespace NBus { } else if (LocalFlags == NPrivate::MESSAGE_IN_WORK && !inWork) { LocalFlags = 0; } else { - Y_FAIL("impossible combination of flag and parameter: %s %d", + Y_ABORT("impossible combination of flag and parameter: %s %d", inWork ? "true" : "false", unsigned(LocalFlags)); } } diff --git a/library/cpp/messagebus/messqueue.cpp b/library/cpp/messagebus/messqueue.cpp index 85baa3c383..789b86a15e 100644 --- a/library/cpp/messagebus/messqueue.cpp +++ b/library/cpp/messagebus/messqueue.cpp @@ -146,7 +146,7 @@ TBusServerSessionPtr TBusMessageQueue::CreateDestination(TBusProtocol* proto, IB Add(session.Get()); return session.Release(); } catch (...) { - Y_FAIL("create destination failure: %s", CurrentExceptionMessage().c_str()); + Y_ABORT("create destination failure: %s", CurrentExceptionMessage().c_str()); } } @@ -157,7 +157,7 @@ TBusServerSessionPtr TBusMessageQueue::CreateDestination(TBusProtocol* proto, IB Add(session.Get()); return session.Release(); } catch (...) { - Y_FAIL("create destination failure: %s", CurrentExceptionMessage().c_str()); + Y_ABORT("create destination failure: %s", CurrentExceptionMessage().c_str()); } } diff --git a/library/cpp/messagebus/oldmodule/module.cpp b/library/cpp/messagebus/oldmodule/module.cpp index 4ec37a4d53..7db3a9af42 100644 --- a/library/cpp/messagebus/oldmodule/module.cpp +++ b/library/cpp/messagebus/oldmodule/module.cpp @@ -390,7 +390,7 @@ namespace NBus { if (call.Status == MESSAGE_OK) { ++it; // keep pending list until we get reply } else if (call.Status == MESSAGE_BUSY) { - Y_FAIL("MESSAGE_BUSY is prohibited in modules. Please increase MaxInFlight"); + Y_ABORT("MESSAGE_BUSY is prohibited in modules. Please increase MaxInFlight"); } else if (call.Status == MESSAGE_CONNECT_FAILED && call.NumRetries < call.MaxRetries) { ++it; // try up to call.MaxRetries times to send message call.NumRetries++; @@ -480,7 +480,7 @@ namespace NBus { /// if not found, report error if (i == Pending.size()) { - Y_FAIL("must not happen"); + Y_ABORT("must not happen"); } /// fill in response into job state diff --git a/library/cpp/messagebus/protobuf/ybusbuf.cpp b/library/cpp/messagebus/protobuf/ybusbuf.cpp index 7212e59590..c6ef971172 100644 --- a/library/cpp/messagebus/protobuf/ybusbuf.cpp +++ b/library/cpp/messagebus/protobuf/ybusbuf.cpp @@ -47,7 +47,7 @@ void TBusBufferProtocol::Serialize(const TBusMessage* mess, TBuffer& data) { const TBusHeader* header = mess->GetHeader(); if (!IsRegisteredType(header->Type)) { - Y_FAIL("unknown message type: %d", int(header->Type)); + Y_ABORT("unknown message type: %d", int(header->Type)); return; } @@ -69,7 +69,7 @@ TAutoPtr<TBusMessage> TBusBufferProtocol::Deserialize(ui16 messageType, TArrayRe TBusBufferBase* messageTemplate = FindType(messageType); if (messageTemplate == nullptr) { return nullptr; - //Y_FAIL("unknown message type: %d", unsigned(messageType)); + //Y_ABORT("unknown message type: %d", unsigned(messageType)); } // clone the base diff --git a/library/cpp/messagebus/rain_check/core/task.cpp b/library/cpp/messagebus/rain_check/core/task.cpp index d8aeefac25..0d4dd198a5 100644 --- a/library/cpp/messagebus/rain_check/core/task.cpp +++ b/library/cpp/messagebus/rain_check/core/task.cpp @@ -142,7 +142,7 @@ void TSubtaskCompletion::SetRunning(TTaskRunnerBase* parent) { for (;;) { ESubtaskState current = State.Get(); if (current != CREATED && current != DONE) { - Y_FAIL("current state should be CREATED or DONE: %s", ToCString(current)); + Y_ABORT("current state should be CREATED or DONE: %s", ToCString(current)); } if (State.CompareAndSet(current, RUNNING)) { return; @@ -166,7 +166,7 @@ void TSubtaskCompletion::SetDone() { break; } } else { - Y_FAIL("cannot SetDone: unknown state: %s", ToCString(state)); + Y_ABORT("cannot SetDone: unknown state: %s", ToCString(state)); } } diff --git a/library/cpp/messagebus/rain_check/core/task.h b/library/cpp/messagebus/rain_check/core/task.h index 7d8778bcda..c5fa86323a 100644 --- a/library/cpp/messagebus/rain_check/core/task.h +++ b/library/cpp/messagebus/rain_check/core/task.h @@ -99,9 +99,9 @@ namespace NRainCheck { case CANCELED: return true; case CREATED: - Y_FAIL("not started"); + Y_ABORT("not started"); default: - Y_FAIL("unknown value: %u", (unsigned)state); + Y_ABORT("unknown value: %u", (unsigned)state); } } diff --git a/library/cpp/messagebus/rain_check/http/client_ut.cpp b/library/cpp/messagebus/rain_check/http/client_ut.cpp index 1628114391..747128b0b0 100644 --- a/library/cpp/messagebus/rain_check/http/client_ut.cpp +++ b/library/cpp/messagebus/rain_check/http/client_ut.cpp @@ -74,7 +74,7 @@ namespace { const int THR_POOL_SIZE = 2; runner->ForkLoop(THR_POOL_SIZE); } catch (...) { - Y_FAIL("Can't run server: %s", CurrentExceptionMessage().data()); + Y_ABORT("Can't run server: %s", CurrentExceptionMessage().data()); } return runner; diff --git a/library/cpp/messagebus/remote_client_connection.cpp b/library/cpp/messagebus/remote_client_connection.cpp index 30a7fc25fb..2fa56f7902 100644 --- a/library/cpp/messagebus/remote_client_connection.cpp +++ b/library/cpp/messagebus/remote_client_connection.cpp @@ -252,7 +252,7 @@ void TRemoteClientConnection::ReaderProcessMessageUnknownVersion(TArrayRef<const LWPROBE(Error, ToString(MESSAGE_INVALID_VERSION), ToString(PeerAddr), ""); ReaderData.Status.Incremental.StatusCounter[MESSAGE_INVALID_VERSION] += 1; // TODO: close connection - Y_FAIL("unknown message"); + Y_ABORT("unknown message"); } void TRemoteClientConnection::ClearOutgoingQueue(TMessagesPtrs& result, bool reconnect) { diff --git a/library/cpp/messagebus/remote_connection.cpp b/library/cpp/messagebus/remote_connection.cpp index 24c2153730..0e79ca084a 100644 --- a/library/cpp/messagebus/remote_connection.cpp +++ b/library/cpp/messagebus/remote_connection.cpp @@ -143,7 +143,7 @@ namespace NBus { } void TRemoteConnection::TryConnect() { - Y_FAIL("TryConnect is client connection only operation"); + Y_ABORT("TryConnect is client connection only operation"); } void TRemoteConnection::ScheduleRead() { diff --git a/library/cpp/messagebus/scheduler_actor_ut.cpp b/library/cpp/messagebus/scheduler_actor_ut.cpp index e81ffd3186..9f52e26f0c 100644 --- a/library/cpp/messagebus/scheduler_actor_ut.cpp +++ b/library/cpp/messagebus/scheduler_actor_ut.cpp @@ -22,7 +22,7 @@ Y_UNIT_TEST_SUITE(TSchedulerActorTests) { void Act(TDefaultTag) { if (!Alarm.FetchTask()) { - Y_FAIL("must not have no spurious wakeups in test"); + Y_ABORT("must not have no spurious wakeups in test"); } TestSync.WaitForAndIncrement(Iteration++); diff --git a/library/cpp/messagebus/socket_addr.cpp b/library/cpp/messagebus/socket_addr.cpp index c1b3a28fbe..71a1277a92 100644 --- a/library/cpp/messagebus/socket_addr.cpp +++ b/library/cpp/messagebus/socket_addr.cpp @@ -36,7 +36,7 @@ NBus::NPrivate::TBusSocketAddr::TBusSocketAddr(const NAddr::IRemoteAddr* addr) break; } default: - Y_FAIL("unknown address family"); + Y_ABORT("unknown address family"); } } diff --git a/library/cpp/messagebus/test/example/client/client.cpp b/library/cpp/messagebus/test/example/client/client.cpp index 8d0f0584e0..e707ec432f 100644 --- a/library/cpp/messagebus/test/example/client/client.cpp +++ b/library/cpp/messagebus/test/example/client/client.cpp @@ -36,7 +36,7 @@ namespace NCalculator { int b = requestMul->Record.GetB(); Cerr << a << " * " << b << " = " << response->Record.GetResult() << "\n"; } else { - Y_FAIL("unknown request"); + Y_ABORT("unknown request"); } } diff --git a/library/cpp/messagebus/test/example/server/server.cpp b/library/cpp/messagebus/test/example/server/server.cpp index 13e52d75f5..dc0cda78fa 100644 --- a/library/cpp/messagebus/test/example/server/server.cpp +++ b/library/cpp/messagebus/test/example/server/server.cpp @@ -39,7 +39,7 @@ namespace NCalculator { response->Record.SetResult(result); request.SendReplyMove(response); } else { - Y_FAIL("unknown request"); + Y_ABORT("unknown request"); } } }; diff --git a/library/cpp/messagebus/test/helper/example.cpp b/library/cpp/messagebus/test/helper/example.cpp index 1ef2809111..80447ca1a8 100644 --- a/library/cpp/messagebus/test/helper/example.cpp +++ b/library/cpp/messagebus/test/helper/example.cpp @@ -83,7 +83,7 @@ void TExampleProtocol::Serialize(const TBusMessage* message, TBuffer& buffer) { } else if (const TExampleResponse* exampleReply = dynamic_cast<const TExampleResponse*>(message)) { buffer.Append(exampleReply->Data.data(), exampleReply->Data.size()); } else { - Y_FAIL("unknown message type"); + Y_ABORT("unknown message type"); } } @@ -204,7 +204,7 @@ void TExampleClient::OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> r void TExampleClient::OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) { if (CrashOnError) { - Y_FAIL("client failed: %s", ToCString(status)); + Y_ABORT("client failed: %s", ToCString(status)); } Y_UNUSED(mess); diff --git a/library/cpp/messagebus/test/helper/message_handler_error.cpp b/library/cpp/messagebus/test/helper/message_handler_error.cpp index c09811ec67..f22f46fa6c 100644 --- a/library/cpp/messagebus/test/helper/message_handler_error.cpp +++ b/library/cpp/messagebus/test/helper/message_handler_error.cpp @@ -6,21 +6,21 @@ using namespace NBus; using namespace NBus::NTest; void TBusClientHandlerError::OnError(TAutoPtr<TBusMessage>, EMessageStatus status) { - Y_FAIL("must not be called, status: %s", ToString(status).data()); + Y_ABORT("must not be called, status: %s", ToString(status).data()); } void TBusClientHandlerError::OnReply(TAutoPtr<TBusMessage>, TAutoPtr<TBusMessage>) { - Y_FAIL("must not be called"); + Y_ABORT("must not be called"); } void TBusClientHandlerError::OnMessageSentOneWay(TAutoPtr<TBusMessage>) { - Y_FAIL("must not be called"); + Y_ABORT("must not be called"); } void TBusServerHandlerError::OnError(TAutoPtr<TBusMessage>, EMessageStatus status) { - Y_FAIL("must not be called, status: %s", ToString(status).data()); + Y_ABORT("must not be called, status: %s", ToString(status).data()); } void TBusServerHandlerError::OnMessage(TOnMessageContext&) { - Y_FAIL("must not be called"); + Y_ABORT("must not be called"); } diff --git a/library/cpp/messagebus/test/perftest/perftest.cpp b/library/cpp/messagebus/test/perftest/perftest.cpp index 3084c9e01c..0a681a5c4d 100644 --- a/library/cpp/messagebus/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/test/perftest/perftest.cpp @@ -279,7 +279,7 @@ public: //delete message; //Sleep(TDuration::MilliSeconds(1)); //continue; - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); } else if (ret == MESSAGE_SHUTDOWN) { delete message; } else { diff --git a/library/cpp/messagebus/test/ut/messagebus_ut.cpp b/library/cpp/messagebus/test/ut/messagebus_ut.cpp index 8f6aa6a295..27886ad74c 100644 --- a/library/cpp/messagebus/test/ut/messagebus_ut.cpp +++ b/library/cpp/messagebus/test/ut/messagebus_ut.cpp @@ -555,7 +555,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { TAutoPtr<TExampleResponse> resp(new TExampleResponse(&Proto.ResponseCount, 10)); req.SendReplyMove(resp); } else { - Y_FAIL("wrong"); + Y_ABORT("wrong"); } } }; diff --git a/library/cpp/messagebus/test/ut/moduletest.h b/library/cpp/messagebus/test/ut/moduletest.h index d5da72c0cb..665afbdf59 100644 --- a/library/cpp/messagebus/test/ut/moduletest.h +++ b/library/cpp/messagebus/test/ut/moduletest.h @@ -77,7 +77,7 @@ namespace NBus { } else if (messageType == TYPE_HOSTINFORESPONSE) { return new THostInfoReply(MESSAGE_CREATE_UNINITIALIZED); } else { - Y_FAIL("unknown"); + Y_ABORT("unknown"); } } }; diff --git a/library/cpp/messagebus/test/ut/one_way_ut.cpp b/library/cpp/messagebus/test/ut/one_way_ut.cpp index 0b90985289..a391669b39 100644 --- a/library/cpp/messagebus/test/ut/one_way_ut.cpp +++ b/library/cpp/messagebus/test/ut/one_way_ut.cpp @@ -125,7 +125,7 @@ public: /// this handler should not be called because this server does not send replies void OnSent(TAutoPtr<TBusMessage> mess) override { Y_UNUSED(mess); - Y_FAIL("This server does not sent replies"); + Y_ABORT("This server does not sent replies"); } }; diff --git a/library/cpp/messagebus/test/ut/starter_ut.cpp b/library/cpp/messagebus/test/ut/starter_ut.cpp index dd4d3aaa5e..548e83ae5a 100644 --- a/library/cpp/messagebus/test/ut/starter_ut.cpp +++ b/library/cpp/messagebus/test/ut/starter_ut.cpp @@ -89,7 +89,7 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { } TJobHandler Never(TBusJob*, TBusMessage*) { - Y_FAIL("happens"); + Y_ABORT("happens"); throw 1; } }; diff --git a/library/cpp/messagebus/www/www.cpp b/library/cpp/messagebus/www/www.cpp index a52ad404ff..9c3e0f522d 100644 --- a/library/cpp/messagebus/www/www.cpp +++ b/library/cpp/messagebus/www/www.cpp @@ -57,7 +57,7 @@ namespace { } } - Y_FAIL("unregistered"); + Y_ABORT("unregistered"); } void Add(TValuePtr p) { diff --git a/library/cpp/monlib/dynamic_counters/page.cpp b/library/cpp/monlib/dynamic_counters/page.cpp index f2fdd61710..c0d523248a 100644 --- a/library/cpp/monlib/dynamic_counters/page.cpp +++ b/library/cpp/monlib/dynamic_counters/page.cpp @@ -111,7 +111,7 @@ void TDynamicCountersPage::HandleAbsentSubgroup(IMonHttpRequest& request) { } else if (UnknownGroupPolicy == EUnknownGroupPolicy::Ignore) { NoContent(request); } else { - Y_FAIL("Unsupported policy set"); + Y_ABORT("Unsupported policy set"); } } diff --git a/library/cpp/monlib/encode/format.cpp b/library/cpp/monlib/encode/format.cpp index fd16d690cb..63f9932aad 100644 --- a/library/cpp/monlib/encode/format.cpp +++ b/library/cpp/monlib/encode/format.cpp @@ -86,7 +86,7 @@ namespace NMonitoring { return TStringBuf(); } - Y_FAIL(); // for GCC + Y_ABORT(); // for GCC } ECompression CompressionFromAcceptEncodingHeader(TStringBuf value) { @@ -111,7 +111,7 @@ namespace NMonitoring { return TStringBuf(); } - Y_FAIL(); // for GCC + Y_ABORT(); // for GCC } } @@ -165,7 +165,7 @@ void Out<NMonitoring::EFormat>(IOutputStream& o, NMonitoring::EFormat f) { return; } - Y_FAIL(); // for GCC + Y_ABORT(); // for GCC } template <> @@ -207,5 +207,5 @@ void Out<NMonitoring::ECompression>(IOutputStream& o, NMonitoring::ECompression return; } - Y_FAIL(); // for GCC + Y_ABORT(); // for GCC } diff --git a/library/cpp/monlib/encode/json/json_ut.cpp b/library/cpp/monlib/encode/json/json_ut.cpp index 09e7909289..49de352062 100644 --- a/library/cpp/monlib/encode/json/json_ut.cpp +++ b/library/cpp/monlib/encode/json/json_ut.cpp @@ -276,7 +276,7 @@ Y_UNIT_TEST_SUITE(TJsonTest) { break; } default: - Y_FAIL("unexpected metric type [%s]", ToString(metricType).c_str()); + Y_ABORT("unexpected metric type [%s]", ToString(metricType).c_str()); } encoder->OnMetricEnd(); diff --git a/library/cpp/monlib/encode/spack/compression.cpp b/library/cpp/monlib/encode/spack/compression.cpp index 5dc6fef960..ab27b533a5 100644 --- a/library/cpp/monlib/encode/spack/compression.cpp +++ b/library/cpp/monlib/encode/spack/compression.cpp @@ -361,7 +361,7 @@ namespace NMonitoring { case ECompression::UNKNOWN: return nullptr; } - Y_FAIL("invalid compression algorithm"); + Y_ABORT("invalid compression algorithm"); } THolder<IFramedCompressStream> CompressedOutput(IOutputStream* out, ECompression alg) { @@ -377,7 +377,7 @@ namespace NMonitoring { case ECompression::UNKNOWN: return nullptr; } - Y_FAIL("invalid compression algorithm"); + Y_ABORT("invalid compression algorithm"); } } diff --git a/library/cpp/monlib/encode/spack/spack_v1_decoder.cpp b/library/cpp/monlib/encode/spack/spack_v1_decoder.cpp index 1f445fc80d..384ef456dd 100644 --- a/library/cpp/monlib/encode/spack/spack_v1_decoder.cpp +++ b/library/cpp/monlib/encode/spack/spack_v1_decoder.cpp @@ -258,7 +258,7 @@ namespace NMonitoring { case ETimePrecision::MILLIS: return TInstant::MilliSeconds(ReadFixed<ui64>()); } - Y_FAIL("invalid time precision"); + Y_ABORT("invalid time precision"); } template <typename T> @@ -413,7 +413,7 @@ namespace NMonitoring { case ECompression::UNKNOWN: return Max<ui8>(); } - Y_FAIL(); // for GCC + Y_ABORT(); // for GCC } ECompression DecodeCompression(ui8 byte) { diff --git a/library/cpp/monlib/metrics/metric_value.h b/library/cpp/monlib/metrics/metric_value.h index 607fcc8602..be9d3e68dd 100644 --- a/library/cpp/monlib/metrics/metric_value.h +++ b/library/cpp/monlib/metrics/metric_value.h @@ -120,7 +120,7 @@ namespace NMonitoring { case EMetricValueType::UNKNOWN: ythrow yexception() << "unknown value type"; } - Y_FAIL(); // for GCC + Y_ABORT(); // for GCC } ui64 AsUint64() const noexcept { @@ -146,7 +146,7 @@ namespace NMonitoring { case EMetricValueType::UNKNOWN: ythrow yexception() << "unknown value type"; } - Y_FAIL(); // for GCC + Y_ABORT(); // for GCC } i64 AsInt64() const noexcept { @@ -172,7 +172,7 @@ namespace NMonitoring { case EMetricValueType::UNKNOWN: ythrow yexception() << "unknown value type"; } - Y_FAIL(); // for GCC + Y_ABORT(); // for GCC } IHistogramSnapshot* AsHistogram() const noexcept { diff --git a/library/cpp/monlib/service/service.cpp b/library/cpp/monlib/service/service.cpp index 929efbf816..93b2d10b0c 100644 --- a/library/cpp/monlib/service/service.cpp +++ b/library/cpp/monlib/service/service.cpp @@ -143,7 +143,7 @@ namespace NMonitoring { try { Listener.Bind(TIpAddress(bindAddr, port)); } catch (yexception e) { - Y_FAIL("TCoHttpServer::TCoHttpServer: couldn't bind to %s:%d\n", bindAddr.data(), port); + Y_ABORT("TCoHttpServer::TCoHttpServer: couldn't bind to %s:%d\n", bindAddr.data(), port); } } diff --git a/library/cpp/neh/http2.cpp b/library/cpp/neh/http2.cpp index a685195edf..79e0366de3 100644 --- a/library/cpp/neh/http2.cpp +++ b/library/cpp/neh/http2.cpp @@ -948,7 +948,7 @@ namespace { SuggestPurgeCache(); if (ExceedHardLimit()) { - Y_FAIL("neh::http2 output connections limit reached"); + Y_ABORT("neh::http2 output connections limit reached"); //ythrow yexception() << "neh::http2 output connections limit reached"; } } diff --git a/library/cpp/neh/netliba.cpp b/library/cpp/neh/netliba.cpp index 1f46ed0c1e..3a168b6e7e 100644 --- a/library/cpp/neh/netliba.cpp +++ b/library/cpp/neh/netliba.cpp @@ -403,7 +403,7 @@ namespace { } void AddResponse(TUdpHttpResponse*) override { - Y_FAIL("unexpected response in neh netliba server"); + Y_ABORT("unexpected response in neh netliba server"); } void AddCancel(const TGUID& guid) override { @@ -414,7 +414,7 @@ namespace { } void AddRequestAck(const TGUID&) override { - Y_FAIL("unexpected acc in neh netliba server"); + Y_ABORT("unexpected acc in neh netliba server"); } void UpdateInProcess() { diff --git a/library/cpp/neh/netliba_udp_http.cpp b/library/cpp/neh/netliba_udp_http.cpp index 1e89347a13..b0b0e0ff03 100644 --- a/library/cpp/neh/netliba_udp_http.cpp +++ b/library/cpp/neh/netliba_udp_http.cpp @@ -322,7 +322,7 @@ namespace NNehNetliba { void SendResponse(const TGUID& reqId, TVector<char>* data) override { if (data && data->size() > MAX_PACKET_SIZE) { - Y_FAIL( + Y_ABORT( "data size is too large; data->size()=%" PRISZT ", MAX_PACKET_SIZE=%" PRISZT, data->size(), MAX_PACKET_SIZE); } diff --git a/library/cpp/presort/presort.h b/library/cpp/presort/presort.h index 0294892580..11b487e6b1 100644 --- a/library/cpp/presort/presort.h +++ b/library/cpp/presort/presort.h @@ -212,7 +212,7 @@ namespace NPresort { ctx.Filled = byte & OptionalFilled; break; default: - Y_FAIL("Invalid record code: %d", (int)code); + Y_ABORT("Invalid record code: %d", (int)code); } ctx.Code = (ECode)code; return true; diff --git a/library/cpp/scheme/scimpl_private.cpp b/library/cpp/scheme/scimpl_private.cpp index 024bf8cc3b..cf35a3d767 100644 --- a/library/cpp/scheme/scimpl_private.cpp +++ b/library/cpp/scheme/scimpl_private.cpp @@ -58,7 +58,7 @@ namespace NSc { case EMode::Throw: ythrow TSchemeException() << "REFERENCE LOOP DETECTED"; case EMode::Abort: - Y_FAIL("REFERENCE LOOP DETECTED"); + Y_ABORT("REFERENCE LOOP DETECTED"); break; case EMode::Stderr: Cerr << "REFERENCE LOOP DETECTED: " << JoinStrings(Vector.begin(), Vector.end(), ", ") diff --git a/library/cpp/scheme/tests/fuzz_ops/lib/vm_apply.cpp b/library/cpp/scheme/tests/fuzz_ops/lib/vm_apply.cpp index ada7b8854f..1a6400457f 100644 --- a/library/cpp/scheme/tests/fuzz_ops/lib/vm_apply.cpp +++ b/library/cpp/scheme/tests/fuzz_ops/lib/vm_apply.cpp @@ -17,7 +17,7 @@ namespace NSc::NUt { op(st.RRef(act.GetSrc(arg).Pos)); \ break; \ default: \ - Y_FAIL(); \ + Y_ABORT(); \ } @@ -58,7 +58,7 @@ namespace NSc::NUt { st.LRef(act.GetDst(arg).Pos) = std::move(op); \ break; \ default: \ - Y_FAIL(); \ + Y_ABORT(); \ } @@ -74,7 +74,7 @@ namespace NSc::NUt { st.LRef(act.GetRef(arg).Pos) = op; \ break; \ default: \ - Y_FAIL(); \ + Y_ABORT(); \ } #define Y_GEN_PTR_OP(op, arg, st, act) \ @@ -90,7 +90,7 @@ namespace NSc::NUt { st.LRef(act.GetRef(arg).Pos) = *r; \ break; \ default: \ - Y_FAIL(); \ + Y_ABORT(); \ } \ } @@ -116,7 +116,7 @@ namespace NSc::NUt { Y_GEN_TRY_OP(st.TryPushBack(st.RRef(act.GetSrc(0).Pos))) break; default: - Y_FAIL(); + Y_ABORT(); } return true; @@ -137,7 +137,7 @@ namespace NSc::NUt { Y_GEN_TRY_OP(st.TryPushFront(st.RRef(act.GetSrc(0).Pos))) break; default: - Y_FAIL(); + Y_ABORT(); } return true; @@ -296,7 +296,7 @@ namespace NSc::NUt { return true; default: - Y_FAIL(); + Y_ABORT(); } } } diff --git a/library/cpp/scheme/tests/fuzz_ops/lib/vm_parse.cpp b/library/cpp/scheme/tests/fuzz_ops/lib/vm_parse.cpp index a03f5aef53..a73a7d6cbc 100644 --- a/library/cpp/scheme/tests/fuzz_ops/lib/vm_parse.cpp +++ b/library/cpp/scheme/tests/fuzz_ops/lib/vm_parse.cpp @@ -80,7 +80,7 @@ namespace NSc::NUt { case TRef::T_CREATE_BACK: return ref; default: - Y_FAIL(); + Y_ABORT(); } } @@ -99,7 +99,7 @@ namespace NSc::NUt { } return src; default: - Y_FAIL(); + Y_ABORT(); } } @@ -125,7 +125,7 @@ namespace NSc::NUt { case TDst::T_CREATE_BACK_RREF: return dst; default: - Y_FAIL(); + Y_ABORT(); } } diff --git a/library/cpp/skiff/skiff_schema-inl.h b/library/cpp/skiff/skiff_schema-inl.h index d66325b222..853ff36738 100644 --- a/library/cpp/skiff/skiff_schema-inl.h +++ b/library/cpp/skiff/skiff_schema-inl.h @@ -39,7 +39,7 @@ inline bool IsSimpleType(EWireType type) case EWireType::RepeatedVariant16: return false; } - Y_FAIL(); + Y_ABORT(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/skiff/skiff_validator.cpp b/library/cpp/skiff/skiff_validator.cpp index 0406e9fdc2..76dd3b7600 100644 --- a/library/cpp/skiff/skiff_validator.cpp +++ b/library/cpp/skiff/skiff_validator.cpp @@ -35,7 +35,7 @@ struct IValidatorNode virtual void OnChildDone(TValidatorNodeStack* /*validatorNodeStack*/) { - Y_FAIL(); + Y_ABORT(); } virtual void OnSimpleType(TValidatorNodeStack* /*validatorNodeStack*/, EWireType wireType) @@ -388,7 +388,7 @@ std::shared_ptr<IValidatorNode> CreateUsageValidatorNode(const std::shared_ptr<T case EWireType::RepeatedVariant16: return std::make_shared<TRepeatedVariant16TypeUsageValidator>(CreateUsageValidatorNodeList(skiffSchema->GetChildren())); } - Y_FAIL(); + Y_ABORT(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/testing/common/network.cpp b/library/cpp/testing/common/network.cpp index a1f9f22e5a..9f018f69b7 100644 --- a/library/cpp/testing/common/network.cpp +++ b/library/cpp/testing/common/network.cpp @@ -25,7 +25,7 @@ namespace { #define Y_VERIFY_SYSERROR(expr) \ do { \ if (!(expr)) { \ - Y_FAIL(#expr ", errno=%d", LastSystemError()); \ + Y_ABORT(#expr ", errno=%d", LastSystemError()); \ } \ } while (false) @@ -137,7 +137,7 @@ namespace { } } - Y_FAIL("Cannot get free port!"); + Y_ABORT("Cannot get free port!"); } TVector<NTesting::TPortHolder> GetFreePortsRange(size_t count) const { @@ -167,7 +167,7 @@ namespace { ports.clear(); } } - Y_FAIL("Cannot get range of %zu ports!", count); + Y_ABORT("Cannot get range of %zu ports!", count); } NTesting::TPortHolder GetPort(ui16 port) const { @@ -176,7 +176,7 @@ namespace { if (ackport) { return NTesting::TPortHolder{std::move(ackport)}; } - Y_FAIL("Cannot acquire port %hu!", port); + Y_ABORT("Cannot acquire port %hu!", port); } return GetFreePort(); } diff --git a/library/cpp/testing/unittest/junit.cpp b/library/cpp/testing/unittest/junit.cpp index 44771ecd14..0c83625110 100644 --- a/library/cpp/testing/unittest/junit.cpp +++ b/library/cpp/testing/unittest/junit.cpp @@ -278,7 +278,7 @@ void TJUnitProcessor::MakeReportFileName() { if (ResultReportFileName.empty()) { Cerr << "Could not find a vacant file name to write report for path " << FileName << ", maximum number of reports: " << MaxReps << Endl; - Y_FAIL("Cannot write report"); + Y_ABORT("Cannot write report"); } } diff --git a/library/cpp/threading/light_rw_lock/lightrwlock.h b/library/cpp/threading/light_rw_lock/lightrwlock.h index bfe4e9b00c..abb97d6f7c 100644 --- a/library/cpp/threading/light_rw_lock/lightrwlock.h +++ b/library/cpp/threading/light_rw_lock/lightrwlock.h @@ -124,7 +124,7 @@ namespace NS_LightRWLock { return; if (errno == EINTR) continue; - Y_FAIL("futex error"); + Y_ABORT("futex error"); } } } @@ -133,7 +133,7 @@ namespace NS_LightRWLock { const int result = syscall(SYS_futex, &fvar, FUTEX_WAKE_PRIVATE, amount, NULL, NULL, 0); if (Y_UNLIKELY(result == -1)) - Y_FAIL("futex error"); + Y_ABORT("futex error"); } } diff --git a/library/cpp/type_info/type.cpp b/library/cpp/type_info/type.cpp index d2c2fc6a5f..fb084fa18b 100644 --- a/library/cpp/type_info/type.cpp +++ b/library/cpp/type_info/type.cpp @@ -194,7 +194,7 @@ namespace NTi { if (Y_LIKELY(IsRc(factoryOrRc))) { size_t rc = FactoryOrRc_.fetch_sub(2, std::memory_order_acq_rel); if (rc == 2) { - Y_FAIL("DecRef isn't supposed to drop"); + Y_ABORT("DecRef isn't supposed to drop"); } } else if (Y_LIKELY(IsFactory(factoryOrRc))) { auto factory = CastToFactory(factoryOrRc); diff --git a/library/cpp/type_info/type_complexity.cpp b/library/cpp/type_info/type_complexity.cpp index 073c24b909..b994cc2187 100644 --- a/library/cpp/type_info/type_complexity.cpp +++ b/library/cpp/type_info/type_complexity.cpp @@ -71,7 +71,7 @@ int ComputeTypeComplexity(const TType* type) return 1 + ComputeTypeComplexity(type->AsTaggedRaw()->GetItemType()); } } - Y_FAIL("internal error: unreachable code"); + Y_ABORT("internal error: unreachable code"); } } // namespace NTi diff --git a/library/cpp/type_info/type_factory.cpp b/library/cpp/type_info/type_factory.cpp index 9d60307938..cc4206e012 100644 --- a/library/cpp/type_info/type_factory.cpp +++ b/library/cpp/type_info/type_factory.cpp @@ -336,7 +336,7 @@ namespace NTi { void DecRef() noexcept override { if (Counter_.Dec() == 0) { - Y_FAIL("DecRef is not supposed to drop"); + Y_ABORT("DecRef is not supposed to drop"); } } @@ -453,22 +453,22 @@ namespace NTi { void RefType(NTi::TType* type) noexcept override { Y_UNUSED(type); - Y_FAIL("not supposed to be called"); + Y_ABORT("not supposed to be called"); } void UnRefType(NTi::TType* type) noexcept override { Y_UNUSED(type); - Y_FAIL("not supposed to be called"); + Y_ABORT("not supposed to be called"); } void DecRefType(NTi::TType* type) noexcept override { Y_UNUSED(type); - Y_FAIL("not supposed to be called"); + Y_ABORT("not supposed to be called"); } long RefCountType(const NTi::TType* type) const noexcept override { Y_UNUSED(type); - Y_FAIL("not supposed to be called"); + Y_ABORT("not supposed to be called"); } }; diff --git a/library/cpp/unified_agent_client/grpc_io.cpp b/library/cpp/unified_agent_client/grpc_io.cpp index 569e04dde8..8c679ea924 100644 --- a/library/cpp/unified_agent_client/grpc_io.cpp +++ b/library/cpp/unified_agent_client/grpc_io.cpp @@ -106,7 +106,7 @@ namespace NUnifiedAgent { try { static_cast<IIOCallback*>(tag)->OnIOCompleted(ok ? EIOStatus::Ok : EIOStatus::Error); } catch (...) { - Y_FAIL("unexpected exception [%s]", CurrentExceptionMessage().c_str()); + Y_ABORT("unexpected exception [%s]", CurrentExceptionMessage().c_str()); } } }); diff --git a/library/cpp/yaml/fyamlcpp/fyamlcpp.cpp b/library/cpp/yaml/fyamlcpp/fyamlcpp.cpp index bea2ea4c7e..cf5d01ef70 100644 --- a/library/cpp/yaml/fyamlcpp/fyamlcpp.cpp +++ b/library/cpp/yaml/fyamlcpp/fyamlcpp.cpp @@ -864,7 +864,7 @@ fy_event_type GetOpenEventType(ENodeType type) { case ENodeType::Sequence: return FYET_SEQUENCE_START; default: - Y_FAIL("Not a brackets type"); + Y_ABORT("Not a brackets type"); } } @@ -875,7 +875,7 @@ fy_event_type GetCloseEventType(ENodeType type) { case ENodeType::Sequence: return FYET_SEQUENCE_END; default: - Y_FAIL("Not a brackets type"); + Y_ABORT("Not a brackets type"); } } diff --git a/library/cpp/yson/detail.h b/library/cpp/yson/detail.h index 96b35f965c..23971d2d69 100644 --- a/library/cpp/yson/detail.h +++ b/library/cpp/yson/detail.h @@ -591,7 +591,7 @@ namespace NYson { throwIncorrectBoolean(); } - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); ; } @@ -735,7 +735,7 @@ namespace NYson { } void RefreshBlock() { - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); } void Advance(size_t bytes) { diff --git a/library/cpp/yson/lexer_detail.h b/library/cpp/yson/lexer_detail.h index 0bba30acdd..11e122509e 100644 --- a/library/cpp/yson/lexer_detail.h +++ b/library/cpp/yson/lexer_detail.h @@ -217,7 +217,7 @@ namespace NYson { } else if (state == EReadStartCase::BinaryTrue) { *token = TToken(true); } else { - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); } } } else { // BinaryStringOrOtherSpecialToken = x0b diff --git a/library/cpp/yson/node/node.cpp b/library/cpp/yson/node/node.cpp index 3733c3cae2..5156033cfe 100644 --- a/library/cpp/yson/node/node.cpp +++ b/library/cpp/yson/node/node.cpp @@ -71,7 +71,7 @@ bool operator<(const TNode& lhs, const TNode& rhs) case TNode::Undefined: return false; default: - Y_FAIL("Unexpected type: %d", lhs.GetType()); + Y_ABORT("Unexpected type: %d", lhs.GetType()); } } diff --git a/library/cpp/yson/node/node_visitor.cpp b/library/cpp/yson/node/node_visitor.cpp index 41181a7507..258afc21ea 100644 --- a/library/cpp/yson/node/node_visitor.cpp +++ b/library/cpp/yson/node/node_visitor.cpp @@ -83,7 +83,7 @@ void TNodeVisitor::VisitAny(const TNode& node) case TNode::Undefined: ythrow TNode::TTypeError() << "unable to visit TNode of type " << node.GetType(); default: - Y_FAIL("Unexpected type: %d", node.GetType()); + Y_ABORT("Unexpected type: %d", node.GetType()); } } diff --git a/library/cpp/yson/parser_detail.h b/library/cpp/yson/parser_detail.h index bf9fbfcedf..9d8315dd60 100644 --- a/library/cpp/yson/parser_detail.h +++ b/library/cpp/yson/parser_detail.h @@ -35,7 +35,7 @@ namespace NYson { break; default: - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); } while (!(TBase::IsFinished() && TBase::IsEmpty())) { diff --git a/library/cpp/yson/token.cpp b/library/cpp/yson/token.cpp index c8584c8c2e..589bb6c089 100644 --- a/library/cpp/yson/token.cpp +++ b/library/cpp/yson/token.cpp @@ -72,7 +72,7 @@ namespace NYson { case ETokenType::Comma: return ','; default: - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); } } @@ -106,7 +106,7 @@ namespace NYson { case ETokenType::Uint64: case ETokenType::Double: case ETokenType::Boolean: - Y_FAIL("unreachable"); + Y_ABORT("unreachable"); default: break; } |