Browse Source

Y_VERIFY_DEBUG->Y_DEBUG_ABORT_UNLESS at '-v ydb'

https://clubs.at.yandex-team.ru/arcadia/29404
ilnurkh 1 year ago
parent
commit
23b4cd8615

+ 1 - 1
library/cpp/actors/core/actor.cpp

@@ -101,7 +101,7 @@ namespace NActors {
     }
 
     TActorId TActivationContext::RegisterWithSameMailbox(IActor* actor, TActorId parentId) {
-        Y_VERIFY_DEBUG(parentId);
+        Y_DEBUG_ABORT_UNLESS(parentId);
         auto& ctx = *TlsActivationContext;
         return ctx.ExecutorThread.RegisterActor(actor, &ctx.Mailbox, parentId.Hint(), parentId);
     }

+ 1 - 1
library/cpp/actors/core/actor.h

@@ -694,7 +694,7 @@ namespace NActors {
 #define STFUNC(funcName) void funcName(TAutoPtr<::NActors::IEventHandle>& ev)
 #define STATEFN(funcName) void funcName(TAutoPtr<::NActors::IEventHandle>& ev)
 
-#define STFUNC_STRICT_UNHANDLED_MSG_HANDLER Y_VERIFY_DEBUG(false, "%s: unexpected message type 0x%08" PRIx32, __func__, etype);
+#define STFUNC_STRICT_UNHANDLED_MSG_HANDLER Y_DEBUG_ABORT_UNLESS(false, "%s: unexpected message type 0x%08" PRIx32, __func__, etype);
 
 #define STFUNC_BODY(HANDLERS, UNHANDLED_MSG_HANDLER)                    \
     switch (const ui32 etype = ev->GetTypeRewrite()) {                  \

+ 2 - 2
library/cpp/actors/core/actor_virtual.h

@@ -19,7 +19,7 @@ public:
     TEventContext(std::unique_ptr<IEventHandle> handle)
         : Handle(std::move(handle))
     {
-        Y_VERIFY_DEBUG(dynamic_cast<TEvent*>(Handle->GetBase()));
+        Y_DEBUG_ABORT_UNLESS(dynamic_cast<TEvent*>(Handle->GetBase()));
         Event = static_cast<TEvent*>(Handle->GetBase());
         Y_ABORT_UNLESS(Event);
     }
@@ -29,7 +29,7 @@ template <class TEvent, class TExpectedActor>
 class IEventForActor: public IEventBase {
 protected:
     virtual bool DoExecute(IActor* actor, std::unique_ptr<IEventHandle> eventPtr) override {
-        Y_VERIFY_DEBUG(dynamic_cast<TExpectedActor*>(actor));
+        Y_DEBUG_ABORT_UNLESS(dynamic_cast<TExpectedActor*>(actor));
         auto* actorCorrect = static_cast<TExpectedActor*>(actor);
         TEventContext<TEvent> context(std::move(eventPtr));
         actorCorrect->ProcessEvent(context);

+ 3 - 3
library/cpp/actors/core/actorid.h

@@ -43,7 +43,7 @@ namespace NActors {
         }
 
         explicit TActorId(ui32 nodeId, ui32 poolId, ui64 localId, ui32 hint) noexcept {
-            Y_VERIFY_DEBUG(poolId <= MaxPoolID);
+            Y_DEBUG_ABORT_UNLESS(poolId <= MaxPoolID);
             Raw.N.LocalId = localId;
             Raw.N.Hint = hint;
             Raw.N.NodeId = nodeId | (poolId << PoolIndexShift);
@@ -83,7 +83,7 @@ namespace NActors {
         }
 
         TStringBuf ServiceId() const noexcept {
-            Y_VERIFY_DEBUG(IsService());
+            Y_DEBUG_ABORT_UNLESS(IsService());
             return TStringBuf((const char*)Raw.Buf, MaxServiceIDLength);
         }
 
@@ -166,7 +166,7 @@ namespace NActors {
 
         struct TOrderedCmp {
             bool operator()(const TActorId &left, const TActorId &right) const noexcept {
-                Y_VERIFY_DEBUG(!left.IsService() && !right.IsService(), "ordered compare works for plain actorids only");
+                Y_DEBUG_ABORT_UNLESS(!left.IsService() && !right.IsService(), "ordered compare works for plain actorids only");
                 const ui32 n1 = left.NodeId();
                 const ui32 n2 = right.NodeId();
 

+ 3 - 3
library/cpp/actors/core/actorsystem.cpp

@@ -105,7 +105,7 @@ namespace NActors {
 
         if (recpNodeId != NodeId && recpNodeId != 0) {
             // if recipient is not local one - rewrite with forward instruction
-            Y_VERIFY_DEBUG(!ev->HasEvent() || ev->GetBase()->IsSerializable());
+            Y_DEBUG_ABORT_UNLESS(!ev->HasEvent() || ev->GetBase()->IsSerializable());
             Y_ABORT_UNLESS(ev->Recipient == recipient,
                 "Event rewrite from %s to %s would be lost via interconnect",
                 ev->Recipient.ToString().c_str(),
@@ -134,7 +134,7 @@ namespace NActors {
             ev->Rewrite(ev->GetTypeRewrite(), recipient);
         }
 
-        Y_VERIFY_DEBUG(recipient == ev->GetRecipientRewrite());
+        Y_DEBUG_ABORT_UNLESS(recipient == ev->GetRecipientRewrite());
         const ui32 recpPool = recipient.PoolID();
         if (recipient && recpPool < ExecutorPoolCount) {
             if ((CpuManager->GetExecutorPool(recpPool)->*EPSpecificSend)(ev)) {
@@ -200,7 +200,7 @@ namespace NActors {
     }
 
     ui64 TActorSystem::AllocateIDSpace(ui64 count) {
-        Y_VERIFY_DEBUG(count < Max<ui32>() / 65536);
+        Y_DEBUG_ABORT_UNLESS(count < Max<ui32>() / 65536);
 
         static_assert(sizeof(TAtomic) == sizeof(ui64), "expect sizeof(TAtomic) == sizeof(ui64)");
 

+ 2 - 2
library/cpp/actors/core/buffer.cpp

@@ -41,14 +41,14 @@ void TBufferBaseT<PointerType>::Assign(PointerType data, size_t size) noexcept {
 
 template <>
 void TBufferBaseT<void*>::Cut(size_t offset) noexcept {
-    Y_VERIFY_DEBUG(offset <= Size);
+    Y_DEBUG_ABORT_UNLESS(offset <= Size);
     Data = static_cast<char*>(Data) + offset;
     TBufferBase::Size -= offset;
 }
 
 template <>
 void TBufferBaseT<const void*>::Cut(size_t offset) noexcept {
-    Y_VERIFY_DEBUG(offset <= Size);
+    Y_DEBUG_ABORT_UNLESS(offset <= Size);
     Data = static_cast<const char*>(Data) + offset;
     TBufferBase::Size -= offset;
 }

+ 1 - 1
library/cpp/actors/core/cpu_state.h

@@ -97,7 +97,7 @@ namespace NActors {
                 if (Y_UNLIKELY(current == CpuStopped)) {
                     return false;
                 }
-                Y_VERIFY_DEBUG(current < MaxPools, "unexpected already waiting state of cpu (%d)", (int)current);
+                Y_DEBUG_ABORT_UNLESS(current < MaxPools, "unexpected already waiting state of cpu (%d)", (int)current);
                 if (AtomicCas(&State, (state & ~CurrentMask) | CpuSpinning, state)) { // successfully marked as spinning
                     return true;
                 }

+ 1 - 1
library/cpp/actors/core/event.h

@@ -24,7 +24,7 @@ namespace NActors {
     protected:
         // for compatibility with virtual actors
         virtual bool DoExecute(IActor* /*actor*/, std::unique_ptr<IEventHandle> /*eventPtr*/) {
-            Y_VERIFY_DEBUG(false);
+            Y_DEBUG_ABORT_UNLESS(false);
             return false;
         }
     public:

+ 1 - 1
library/cpp/actors/core/event_pb.cpp

@@ -148,7 +148,7 @@ namespace NActors {
         // fill in base params
         BufferPtr = static_cast<char*>(data);
         SizeRemain = size;
-        Y_VERIFY_DEBUG(size);
+        Y_DEBUG_ABORT_UNLESS(size);
 
         // transfer control to the coroutine
         Y_ABORT_UNLESS(Event);

+ 1 - 1
library/cpp/actors/core/event_pb.h

@@ -647,7 +647,7 @@ namespace NActors {
     }
 
     inline void ActorIdToProto(const TActorId& src, NActorsProto::TActorId* dest) {
-        Y_VERIFY_DEBUG(dest);
+        Y_DEBUG_ABORT_UNLESS(dest);
         dest->SetRawX1(src.RawX1());
         dest->SetRawX2(src.RawX2());
     }

Some files were not shown because too many files changed in this diff