Skip to content

YMQ Verify fix #3945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ydb/core/ymq/actor/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,8 @@ class TActionActor
}
}

Y_ABORT_UNLESS(SchemeCache_);

bool isACLProtectedAccount = Cfg().GetForceAccessControl();
if (!IsCloud() && (SecurityToken_ || (Cfg().GetForceAccessControl() && (isACLProtectedAccount = IsACLProtectedAccount(UserName_))))) {
this->Become(&TActionActor::WaitAuthCheckMessages);
Expand All @@ -666,8 +668,6 @@ class TActionActor
return;
}

Y_ABORT_UNLESS(SchemeCache_);

RequestSchemeCache(GetActionACLSourcePath()); // this also checks that requested queue (if any) does exist
RequestTicketParser();
} else {
Expand Down
1 change: 1 addition & 0 deletions ydb/core/ymq/actor/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ void TSqsService::AnswerThrottled(TSqsEvents::TEvGetConfiguration::TPtr& ev) {
RLOG_SQS_REQ_DEBUG(ev->Get()->RequestId, "Throttled because of too many requests for nonexistent queue [" << ev->Get()->QueueName << "] for user [" << ev->Get()->UserName << "] while getting configuration");
auto answer = MakeHolder<TSqsEvents::TEvConfiguration>();
answer->Throttled = true;
answer->SchemeCache = SchemeCache_;
Send(ev->Sender, answer.Release());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from ydb.tests.library.sqs.test_base import KikimrSqsTestBase

throttling_exception_pattern = ".*</Message><Code>ThrottlingException</Code>.*"


class TestSqsThrottlingOnNonexistentQueue(KikimrSqsTestBase):

Expand All @@ -21,8 +23,6 @@ def get_attributes_of_nonexistent_queue():
except Exception:
pass

throttling_exception_pattern = ".*</Message><Code>ThrottlingException</Code>.*"

assert_that(
get_attributes_of_nonexistent_queue,
raises(
Expand All @@ -46,3 +46,25 @@ def get_attributes_of_nonexistent_queue():
pattern=throttling_exception_pattern
)
)

def test_action_which_does_not_requere_existing_queue(self):
queue_url = self._create_queue_and_assert(self.queue_name, False, True)
nonexistent_queue_url = queue_url + "_nonex"

def get_attributes_of_nonexistent_queue():
self._sqs_api.get_queue_attributes(nonexistent_queue_url)

# Draining budget
for _ in range(16):
try:
get_attributes_of_nonexistent_queue()
except Exception:
pass

assert_that(
lambda: self._sqs_api.get_queue_url(self.queue_name + "_nonex"),
raises(
RuntimeError,
pattern=throttling_exception_pattern
)
)
Loading