Skip to content
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

chore: don't auto delete component queue #108

Merged
merged 3 commits into from
Jun 26, 2023

Conversation

xytxytxyt
Copy link
Contributor

in #107 i fixed a typo and set component queues to auto delete

but after using that a bit, i have changed my mind; reasoning below

firstly, according to the documentation, if so configured, these queues will be deleted when the consumer disconnects... i could not find anything on the internet that says the queue has to be empty... so it deletes the queue even if it's not empty, as long as the consumer has disconnected

also it's difficult to update an existing component to ergo 0.11.3 because:

  • queue already exists
  • we upgrade to 0.11.3 and deploy
  • we try to recreate the queue with auto delete
  • this fails because there is already an existing queue with the same name, but without auto delete
  • we have to manually delete the queue and start the component, which will recreate the queue with auto delete

on the other hand, if this pr is approved, going to 0.11.4 will be easy because 0.11.3 queues will be auto deleted when the component shuts down for deploy, so there will be no problem recreating them without auto delete

instance queues remain auto delete, which i think is correct:

self._instance_queue = kombu.Queue(name=instance_queue_name, exchange=self._exchange, routing_key=str(SubTopic(instance_id())), auto_delete=True)

@xytxytxyt xytxytxyt requested a review from herrmt June 22, 2023 00:44
@xytxytxyt
Copy link
Contributor Author

test failures look unrelated (the failures are from parts of the code i did not change)

i don't think the linting job has ever passed

@xytxytxyt
Copy link
Contributor Author

well it passes locally on python 3.9.16 lol

% pytest -vv --timeout 60
======================================================================================================================================================================================================== test session starts =========================================================================================================================================================================================================
platform darwin -- Python 3.9.16, pytest-7.1.3, pluggy-1.0.0 -- /Users/xian/.pyenv/versions/ergo-dev-env/bin/python
cachedir: .pytest_cache
rootdir: /Users/xian/ergo-3rd-copy, configfile: setup.cfg
plugins: timeout-2.1.0, aiomisc-16.2.4
timeout: 60.0s
timeout method: signal
timeout func_only: False
collected 39 items                                                                                                                                                                                                                                                                                                                                                                                                                   

test/integration/test_http.py::test_product PASSED                                                                                                                                                                                                                                                                                                                                                                             [  2%]
test/integration/test_http.py::test_product__post_request PASSED                                                                                                                                                                                                                                                                                                                                                               [  5%]
test/integration/test_http.py::test_return_data[return_dict] PASSED                                                                                                                                                                                                                                                                                                                                                            [  7%]
test/integration/test_http.py::test_return_data[return_one_dict] PASSED                                                                                                                                                                                                                                                                                                                                                        [ 10%]
test/integration/test_http.py::test_return_data[return_two_dicts] PASSED                                                                                                                                                                                                                                                                                                                                                       [ 12%]
test/integration/test_http.py::test_return_data[return_none] PASSED                                                                                                                                                                                                                                                                                                                                                            [ 15%]
test/integration/test_http.py::test_return_data[yield_one_dict] PASSED                                                                                                                                                                                                                                                                                                                                                         [ 17%]
test/integration/test_http.py::test_return_data[yield_two_dicts] PASSED                                                                                                                                                                                                                                                                                                                                                        [ 20%]
test/integration/test_amqp/test_amqp.py::test_product_amqp PASSED                                                                                                                                                                                                                                                                                                                                                              [ 23%]
test/integration/test_amqp/test_amqp.py::test_product_class PASSED                                                                                                                                                                                                                                                                                                                                                             [ 25%]
test/integration/test_amqp/test_amqp.py::test_product_instance PASSED                                                                                                                                                                                                                                                                                                                                                          [ 28%]
test/integration/test_amqp/test_amqp.py::test_return_two_dicts PASSED                                                                                                                                                                                                                                                                                                                                                          [ 30%]
test/integration/test_amqp/test_amqp.py::test_yield_two_dicts PASSED                                                                                                                                                                                                                                                                                                                                                           [ 33%]
test/integration/test_amqp/test_amqp.py::test_error_path PASSED                                                                                                                                                                                                                                                                                                                                                                [ 35%]
test/integration/test_amqp/test_amqp.py::test_make_six PASSED                                                                                                                                                                                                                                                                                                                                                                  [ 38%]
test/integration/test_amqp/test_argument_binding.py::test_bind_falsey_argument PASSED                                                                                                                                                                                                                                                                                                                                          [ 41%]
test/integration/test_amqp/test_argument_binding.py::test_bind_data_to_my_param PASSED                                                                                                                                                                                                                                                                                                                                         [ 43%]
test/integration/test_amqp/test_argument_binding.py::test_bind_data_index_foo_to_my_param PASSED                                                                                                                                                                                                                                                                                                                               [ 46%]
test/integration/test_amqp/test_argument_binding.py::test_dont_bind_data PASSED                                                                                                                                                                                                                                                                                                                                                [ 48%]
test/integration/test_amqp/test_error_pubtopic.py::test_no_error_pubtopic PASSED                                                                                                                                                                                                                                                                                                                                               [ 51%]
test/integration/test_amqp/test_error_pubtopic.py::test_error_pubtopic PASSED                                                                                                                                                                                                                                                                                                                                                  [ 53%]
test/integration/test_amqp/test_extra_error_info.py::test_extra_error_info PASSED                                                                                                                                                                                                                                                                                                                                              [ 56%]
test/integration/test_amqp/test_extra_error_info.py::test_extra_error_info_with_error_pubtopic PASSED                                                                                                                                                                                                                                                                                                                          [ 58%]
test/integration/test_amqp/test_reply_to.py::test_shout PASSED                                                                                                                                                                                                                                                                                                                                                                 [ 61%]
test/integration/test_amqp/test_reply_to.py::test_reply_to_scope PASSED                                                                                                                                                                                                                                                                                                                                                        [ 64%]
test/integration/test_amqp/test_reply_to.py::test_fibonacci PASSED                                                                                                                                                                                                                                                                                                                                                             [ 66%]
test/integration/test_amqp/test_reply_to.py::test_traverse_tree PASSED                                                                                                                                                                                                                                                                                                                                                         [ 69%]
test/integration/test_amqp/test_scope.py::test_simple_scope PASSED                                                                                                                                                                                                                                                                                                                                                             [ 71%]
test/integration/test_amqp/test_scope.py::test_downstream_scope PASSED                                                                                                                                                                                                                                                                                                                                                         [ 74%]
test/integration/test_amqp/test_scope.py::test_nested_scope PASSED                                                                                                                                                                                                                                                                                                                                                             [ 76%]
test/integration/test_amqp/test_scope.py::test_closing_scope PASSED                                                                                                                                                                                                                                                                                                                                                            [ 79%]
test/integration/test_amqp/test_scope.py::test_store_and_retrieve_scope_data PASSED                                                                                                                                                                                                                                                                                                                                            [ 82%]
test/integration/test_gateway/test_gateway.py::test_double PASSED                                                                                                                                                                                                                                                                                                                                                              [ 84%]
test/integration/test_gateway/test_gateway.py::test_gateway_routing PASSED                                                                                                                                                                                                                                                                                                                                                     [ 87%]
test/integration/test_gateway/test_gateway.py::test_yield_twice PASSED                                                                                                                                                                                                                                                                                                                                                         [ 89%]
test/unit/test_cli.py::test_load_config PASSED                                                                                                                                                                                                                                                                                                                                                                                 [ 92%]
test/unit/test_util.py::TestUtil::test_extract PASSED                                                                                                                                                                                                                                                                                                                                                                          [ 94%]
test/unit/test_util.py::TestUtil::test_stack PASSED                                                                                                                                                                                                                                                                                                                                                                            [ 97%]
test/unit/test_util.py::TestUtil::test_util PASSED                                                                                                                                                                                                                                                                                                                                                                             [100%]

======================================================================================================================================================================================================== 39 passed in 12.29s =========================================================================================================================================================================================================

@xytxytxyt xytxytxyt merged commit 8647f0c into master Jun 26, 2023
@xytxytxyt xytxytxyt deleted the chore/component-queue-no-auto-delete branch June 26, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants