|
12 | 12 | #include <util/string/join.h> |
13 | 13 | #include <util/string/vector.h> |
14 | 14 |
|
| 15 | +#define PQ_ENSURE(condition) AFL_ENSURE(condition)("tablet_id", TabletId)("partition_id", Partition) |
| 16 | + |
15 | 17 | namespace NKikimr { |
16 | 18 | namespace NPQ { |
17 | 19 |
|
@@ -96,7 +98,7 @@ void TBasicAccountQuoter::HandleQuotaConsumed(NAccountQuoterEvents::TEvConsumed: |
96 | 98 | << ", consumed in credit " << ConsumedBytesInCredit << "/" << CreditBytes |
97 | 99 | ); |
98 | 100 | auto it = InProcessQuotaRequestCookies.find(ev->Get()->RequestCookie); |
99 | | - Y_ABORT_UNLESS(it != InProcessQuotaRequestCookies.end()); |
| 101 | + PQ_ENSURE(it != InProcessQuotaRequestCookies.end()); |
100 | 102 | InProcessQuotaRequestCookies.erase(it); |
101 | 103 |
|
102 | 104 | if (!QuotaRequestInFlight) { |
@@ -125,14 +127,14 @@ void TBasicAccountQuoter::HandleClearance(TEvQuota::TEvClearance::TPtr& ev, cons |
125 | 127 | LimiterDescription() << "Got quota from Kesus:" << ev->Get()->Result << ". Cookie: " << cookie |
126 | 128 | ); |
127 | 129 |
|
128 | | - Y_ABORT_UNLESS(CurrentQuotaRequestCookie == cookie); |
| 130 | + PQ_ENSURE(CurrentQuotaRequestCookie == cookie); |
129 | 131 | if (!Queue.empty()) { |
130 | 132 | ApproveQuota(Queue.front().Request, Queue.front().StartWait, ctx); |
131 | 133 | Queue.pop_front(); |
132 | 134 | } |
133 | 135 |
|
134 | 136 | if (Y_UNLIKELY(ev->Get()->Result != TEvQuota::TEvClearance::EResult::Success)) { |
135 | | - Y_ABORT_UNLESS(ev->Get()->Result != TEvQuota::TEvClearance::EResult::Deadline); // We set deadline == inf in quota request. |
| 137 | + PQ_ENSURE(ev->Get()->Result != TEvQuota::TEvClearance::EResult::Deadline); // We set deadline == inf in quota request. |
136 | 138 | if (ctx.Now() - LastReportedErrorTime > TDuration::Minutes(1)) { |
137 | 139 | LOG_ERROR_S(ctx, NKikimrServices::PQ_RATE_LIMITER, LimiterDescription() << "Got quota request error: " << ev->Get()->Result); |
138 | 140 | LastReportedErrorTime = ctx.Now(); |
@@ -240,7 +242,7 @@ TQuoterParams TAccountWriteQuoter::CreateQuoterParams( |
240 | 242 | ) { |
241 | 243 | TQuoterParams params; |
242 | 244 | const auto& quotingConfig = pqConfig.GetQuotingConfig(); |
243 | | - Y_ABORT_UNLESS(quotingConfig.GetTopicWriteQuotaEntityToLimit() != NKikimrPQ::TPQConfig::TQuotingConfig::UNSPECIFIED); |
| 245 | + AFL_ENSURE(quotingConfig.GetTopicWriteQuotaEntityToLimit() != NKikimrPQ::TPQConfig::TQuotingConfig::UNSPECIFIED); |
244 | 246 | auto topicPath = topicConverter->GetFederationPath(); |
245 | 247 |
|
246 | 248 | auto topicParts = SplitPath(topicPath); // account/folder/topic // account is first element |
@@ -282,5 +284,15 @@ constexpr NKikimrServices::TActivity::EType TAccountWriteQuoter::ActorActivityTy |
282 | 284 | return NKikimrServices::TActivity::PERSQUEUE_ACCOUNT_WRITE_QUOTER; |
283 | 285 | } |
284 | 286 |
|
| 287 | +bool TBasicAccountQuoter::OnUnhandledException(const std::exception& exc) { |
| 288 | + LOG_CRIT_S(*TlsActivationContext, NKikimrServices::PERSQUEUE, |
| 289 | + LimiterDescription() << " unhandled exception " << TypeName(exc) << ": " << exc.what() << Endl |
| 290 | + << TBackTrace::FromCurrentException().PrintToString()); |
| 291 | + |
| 292 | + Send(TabletActor, new TEvents::TEvPoison()); |
| 293 | + PassAway(); |
| 294 | + return true; |
| 295 | +} |
| 296 | + |
285 | 297 | }// NPQ |
286 | 298 | }// NKikimr |
0 commit comments