-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix(queue): function Queue.can_enqueue
should handle non-existing queue instance correctly
#13198
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
cherry-pick kong-ee
schedule this PR for cherry-picking to kong/kong-ee
label
Jun 13, 2024
ADD-SP
changed the title
fix(queue): function Queue.can_enqueue should handle non-existing queue instance correctly
fix(queue): function Jun 13, 2024
Queue.can_enqueue
should handle non-existing queue instance correctly
chronolaw
reviewed
Jun 13, 2024
ADD-SP
force-pushed
the
add_sp/fix-queue-can-enqueue
branch
from
June 13, 2024 03:27
3055bbf
to
66defc8
Compare
chobits
reviewed
Jun 13, 2024
kong/tools/queue.lua
Outdated
Comment on lines
300
to
312
-- treat non-existing queues having enough capacity. | ||
-- WARNING: The limitation is that if the `entry` is a string and the `queue.max_bytes` is set, | ||
-- and also the `#entry` is larger than `queue.max_bytes`, | ||
-- this function will incorrectly return `false` instead of `true`. | ||
-- This is a limitation of the current implementation. | ||
-- All capacity checking functions needs a Queue instance to work correctly. | ||
-- consturcting a Queue instance just for this function is not efficient, | ||
-- so we just return `true` here. | ||
-- This limitation should not happen in normal usage, | ||
-- as user should be aware of the queue capacity settings | ||
-- to avoid such situation. | ||
return true | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. changing this return value is safe for kong, cause currently there is no users calling this method in kong-ce.
chobits
approved these changes
Jun 13, 2024
chronolaw
reviewed
Jun 13, 2024
…ueue instance correctly
ADD-SP
force-pushed
the
add_sp/fix-queue-can-enqueue
branch
from
June 13, 2024 03:42
66defc8
to
4c8c715
Compare
…sting queue instance correctly
chronolaw
approved these changes
Jun 13, 2024
Successfully created cherry-pick PR for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Treating the non-existing queue instance has enough capacity for enqueueing (fixup #13164)
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
KAG-4270