-
Notifications
You must be signed in to change notification settings - Fork 0
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
Experimental quorum queues #19
Merged
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
phijor
force-pushed
the
experimental-quorum-queues
branch
2 times, most recently
from
January 21, 2021 19:47
8296de9
to
7468533
Compare
phijor
force-pushed
the
experimental-quorum-queues
branch
2 times, most recently
from
January 26, 2021 12:57
3a03e20
to
2ffad69
Compare
bmario
requested changes
Feb 4, 2021
setup.cfg
Outdated
|
||
[metadata] | ||
name = metricq_manager | ||
version = 0.1 |
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.
we should increase the version for this.
phijor
force-pushed
the
experimental-quorum-queues
branch
from
February 9, 2021 09:26
3b09604
to
1d8580d
Compare
bmario
reviewed
Feb 15, 2021
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.
Looks good to me, but I found one typo :)
When changing the queue type of a client queue, its next declaration is going to fail with error code 406 (Precondition failed), since it does not match the arguments of the existing queue. We include the queue type in the queue name to sidestep the problem. Changing the queue type then results in a new queue (with a predictable name) being declared and no conflicts arise. A client re-registering itself with a changed queue type then gets assigned the newly declared queue. Of course, the old queue still exists and needs to be deleted manually. For compatibility with the old code, wee keep queue old names for default queue type.
By using a temporary channel for each operation, failures do not impact later queue operations. This prevents the dreaded "zombie state" where `ChannelClosed` errors appear for every queue operation, after one operation failed. When closing the temporary channel, all related AMQP exceptions are logged and then discarded.
… method This is related to #17: once every Database explicitly calls `db.subscribe` after registering itself, this method should be removed. Then, `handle_db_register` should simply declare the DB queues without any bindings.
Methods should have a name of `{client-type}_{operation}`.
Explain how to use the temporary_channel context manger correctly [1]. For exchanges, aio_pika.Queue.bind() also accepts an exchange name instead of an Exchange object, so after declaring the exchanges we only save their names and use those to bind metrics. For queues, make sure to always retrieve the queue name before dropping the associated channel. No instance of aio_pika.Queue should ever leave a `async with self.temporary_channel():`-block. [1] https://www.urbandictionary.com/define.php?term=You%27re%20Holding%20It%20Wrong
phijor
force-pushed
the
experimental-quorum-queues
branch
from
February 16, 2021 12:23
a531ebe
to
f797b5f
Compare
Rebased and ready to merge :) |
bmario
approved these changes
Feb 16, 2021
This was referenced Feb 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request has kind of outgrown its orignial scope.
What this does:
ConfigParser
classQueueManager
.TODO:
x-metricq
subkey (seeConfigParser.top_level_key
)-
) are not a problemyep, that's explicitly allowed: the receiver must have a catch-all
**kwargs
parameter:{token}[-{uuid}]-{queue_type}-{role}
. This way, changing the queue type and re-declaring a client's queue does not result in errors because of queue argument mismatches. The old queue needs to be deleted by hand though afterwards. (c4ea672)