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

Proposed by Brian Murray
Status: Merged
Merged at revision: ecee8df2c81a397ca8905222da192d2e06f61db7
Proposed branch: autopkgtest-cloud:amqp-traceback
Merge into: autopkgtest-cloud:master
Diff against target: 16 lines (+1/-1)
1 file modified
charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp (+1/-1)
Reviewer Review Type Date Requested Status
Tim Andersson Approve
Review via email: mp+461584@code.launchpad.net

Description of the change

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'

To post a comment you must log in.
Revision history for this message
Tim Andersson (andersson123) wrote :

Oh damn, I think that's my bad! Still weird that it worked for me in the past like this? Maybe because there were less items in the queue or something.

Either way, LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
2index a4e08ab..5cd3b0d 100755
3--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
4+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
5@@ -18,10 +18,10 @@ def filter_amqp(options, host, queue_name, regex):
6 userid=url_parts.username,
7 password=url_parts.password,
8 )
9+ ch = amqp_con.channel()
10 num_items_deleted = 0
11
12 while True:
13- ch = amqp_con.channel()
14 r = ch.basic_get(queue_name)
15 if r is None:
16 logging.debug("r is none, exiting")

Subscribers

People subscribed via source and target branches