diff options
author | sergeyveselov <sergeyveselov@yandex-team.com> | 2023-10-16 10:26:11 +0300 |
---|---|---|
committer | sergeyveselov <sergeyveselov@yandex-team.com> | 2023-10-16 10:47:15 +0300 |
commit | 18a6b7b14b4a48c6f1ef14d495e0ad26d8c7af10 (patch) | |
tree | a46aa9aac4e29c26276fc71592d6ee3ce3221751 | |
parent | 98427c7781b0cd35e4e09533db9057220e50f637 (diff) | |
download | ydb-18a6b7b14b4a48c6f1ef14d495e0ad26d8c7af10.tar.gz |
fix panic on handling throttling when serving get_queue_url
fix panic on handling throttling when serving get_queue_url
-rw-r--r-- | ydb/core/ymq/actor/action.h | 10 | ||||
-rw-r--r-- | ydb/tests/functional/sqs/common/test_throttling_nonexistent_queue.py | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/ydb/core/ymq/actor/action.h b/ydb/core/ymq/actor/action.h index 3ec86e2470..0dfaa5f361 100644 --- a/ydb/core/ymq/actor/action.h +++ b/ydb/core/ymq/actor/action.h @@ -595,8 +595,6 @@ private: QueueLeader_ = ev->Get()->QueueLeader; QuoterResources_ = std::move(ev->Get()->QuoterResources); - Y_ABORT_UNLESS(SchemeCache_); - RLOG_SQS_TRACE("Got configuration. Root url: " << RootUrl_ << ", Shards: " << Shards_ << ", Fail: " << ev->Get()->Fail); @@ -618,6 +616,12 @@ private: } } + if (ev->Get()->Throttled) { + MakeError(MutableErrorDesc(), NErrors::THROTTLING_EXCEPTION, "Too many requests for nonexistent queue."); + SendReplyAndDie(); + return; + } + if (ev->Get()->Fail) { MakeError(MutableErrorDesc(), NErrors::INTERNAL_FAILURE, "Failed to get configuration."); SendReplyAndDie(); @@ -647,6 +651,8 @@ private: return; } + Y_ABORT_UNLESS(SchemeCache_); + RequestSchemeCache(GetActionACLSourcePath()); // this also checks that requested queue (if any) does exist RequestTicketParser(); } else { diff --git a/ydb/tests/functional/sqs/common/test_throttling_nonexistent_queue.py b/ydb/tests/functional/sqs/common/test_throttling_nonexistent_queue.py index 2da8c69ef2..2ed57a9ac3 100644 --- a/ydb/tests/functional/sqs/common/test_throttling_nonexistent_queue.py +++ b/ydb/tests/functional/sqs/common/test_throttling_nonexistent_queue.py @@ -38,3 +38,11 @@ class TestSqsThrottlingOnNonexistentQueue(KikimrSqsTestBase): pattern=throttling_exception_pattern ) ) + + assert_that( + lambda: self._sqs_api.get_queue_url(self.queue_name + "_nonex"), + raises( + RuntimeError, + pattern=throttling_exception_pattern + ) + ) |