← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] autopkgtest-cloud:amqp-traceback into autopkgtest-cloud:master

 

Brian Murray has proposed merging autopkgtest-cloud:amqp-traceback into autopkgtest-cloud:master.

Requested reviews:
  Canonical's Ubuntu QA (canonical-ubuntu-qa)

For more details, see:
https://code.launchpad.net/~ubuntu-release/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/461584

I was seeing a traceback with `filter-amqp` until I made the change in this MP. I believe its because we were creating the "channel" multiple times and using all the channel ids.

2024-02-29 20:14:13,303 - queue item: b'ymuse\n{"triggers": ["cairo/1.18.0-1build3", "glib2.0/2.79.2-1ubuntu1", "libpng1.6/1.6.43-2"], "submit-time": "2024-02-29 09:58:15"}' (deleting)
Traceback (most recent call last):
  File "./filter-amqp", line 105, in <module>
    main()
  File "./filter-amqp", line 91, in main
    num_deleted = filter_amqp(opts, args[0], args[1], args[2])
  File "./filter-amqp", line 24, in filter_amqp
    ch = amqp_con.channel()
  File "/usr/lib/python3/dist-packages/amqplib/client_0_8/connection.py", line 243, in channel
    return Channel(self, channel_id)
  File "/usr/lib/python3/dist-packages/amqplib/client_0_8/channel.py", line 69, in __init__
    channel_id = connection._get_free_channel_id()
  File "/usr/lib/python3/dist-packages/amqplib/client_0_8/connection.py", line 174, in _get_free_channel_id
    raise AMQPException('No free channel ids, current=%d, channel_max=%d'
TypeError: __init__() missing 2 required positional arguments: 'reply_text' and 'method_sig'
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of autopkgtest-cloud:amqp-traceback into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
index a4e08ab..5cd3b0d 100755
--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
@@ -18,10 +18,10 @@ def filter_amqp(options, host, queue_name, regex):
         userid=url_parts.username,
         password=url_parts.password,
     )
+    ch = amqp_con.channel()
     num_items_deleted = 0
 
     while True:
-        ch = amqp_con.channel()
         r = ch.basic_get(queue_name)
         if r is None:
             logging.debug("r is none, exiting")