[Simulator] Error parsing with --topic parameter in notify-client mode

Bug #1824339 reported by Gabriele Santomaggio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.messaging
Fix Released
Undecided
Gabriele Santomaggio

Bug Description

Executing the following code:

python simulator.py --config-file oslo.messaging.conf -d notify-client

There is:
```
2019-04-11 13:30:53,029 DEBUG oslo.messaging._drivers.impl_rabbit [d1778aa9-00bf-4954-b34e-85a183207606] Connected to AMQP server on 127.0.0.1:5672 via [amqp] client with port 51138.
2019-04-11 13:30:53,029 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 16dedb51f57b4fe49d97bf982124a420 NOTIFY exchange 'gabriele_exchange_test' topic 'p.info'
2019-04-11 13:30:53,036 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 09da5b9177c9469bb354876b58a0e77e NOTIFY exchange 'gabriele_exchange_test' topic 'r.info'
2019-04-11 13:30:53,040 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 6fd0f6eb5c5b4157ad80290346851686 NOTIFY exchange 'gabriele_exchange_test' topic 'o.info'
2019-04-11 13:30:53,044 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 6ea4e7890b014ad282d2f81709fd5ccb NOTIFY exchange 'gabriele_exchange_test' topic 'f.info'
2019-04-11 13:30:53,048 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: b78c97020dd44955ab4551d2c65f791b NOTIFY exchange 'gabriele_exchange_test' topic 'i.info'
2019-04-11 13:30:53,052 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 3c07acd9f76d4ce5a7ef77ad0d7dd086 NOTIFY exchange 'gabriele_exchange_test' topic 'l.info'
2019-04-11 13:30:53,056 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 47fd3fd4bae148898b3e51464ca66260 NOTIFY exchange 'gabriele_exchange_test' topic 'e.info'
2019-04-11 13:30:53,059 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 6b48299ee68f408c8a540a12a0473ceb NOTIFY exchange 'gabriele_exchange_test' topic 'r.info'
2019-04-11 13:30:53,060 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: e5eecf6cd077413fa26eedfbe33f9706 NOTIFY exchange 'gabriele_exchange_test' topic '_.info'
2019-04-11 13:30:53,063 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 2e7de39000a641708a6ea7d25e8b3c32 NOTIFY exchange 'gabriele_exchange_test' topic 't.info'
2019-04-11 13:30:53,066 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 4d25b918c1794fd189617446ffa5419f NOTIFY exchange 'gabriele_exchange_test' topic 'o.info'
2019-04-11 13:30:53,067 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: c3eee9f083a34e87b5f5a80af4c8809f NOTIFY exchange 'gabriele_exchange_test' topic 'p.info'
2019-04-11 13:30:53,067 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 05383e116072440c9b2431e065f858ce NOTIFY exchange 'gabriele_exchange_test' topic 'i.info'
2019-04-11 13:30:53,068 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 41b08792214049f9a7aa5376139cd308 NOTIFY exchange 'gabriele_exchange_test' topic 'c.info'
````
as you can see, the "profiler_topic" name is split into different strings, this because of [1]

even you use the topic parameter:

```
python simulator.py -tp myqueue --config-file oslo.messaging.conf -d notify-client
2019-04-11 13:35:57,031 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: f479aa3fd1a8459fa44effb589698bd6 NOTIFY exchange 'gabriele_exchange_test' topic 'm.info'
2019-04-11 13:35:57,039 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 49e7d05272e44879997bcec133c387c8 NOTIFY exchange 'gabriele_exchange_test' topic 'y.info'
2019-04-11 13:35:57,043 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: f0a8abcde51241b08d54214765b2bdd4 NOTIFY exchange 'gabriele_exchange_test' topic 'q.info'
2019-04-11 13:35:57,047 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: a55880d8710442e085a56655e6701c68 NOTIFY exchange 'gabriele_exchange_test' topic 'u.info'
2019-04-11 13:35:57,051 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 3dbb807605b94922ac9a2fc82b8b3a8f NOTIFY exchange 'gabriele_exchange_test' topic 'e.info'
2019-04-11 13:35:57,055 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: 61d842f26d83405d9b1080905c32aa18 NOTIFY exchange 'gabriele_exchange_test' topic 'u.info'
2019-04-11 13:35:57,057 DEBUG oslo_messaging._drivers.amqpdriver CAST unique_id: f1fdd2f43a4c4219b27700a9d35c60a3 NOTIFY exchange 'gabriele_exchange_test' topic 'e.info'
```

The problem is that the input string is considered as an array and then split [1]

The solution is to consider the `topic` param as an array [2], in this way:

functools.partial(NotifyClient, i, transport, [topic],
wait_after_msg)

1- https://github.com/openstack/oslo.messaging/blob/master/oslo_messaging/notify/messaging.py#L65
2- https://github.com/openstack/oslo.messaging/blob/master/tools/simulator.py#L552

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.messaging (master)

Fix proposed to branch: master
Review: https://review.openstack.org/651765

Changed in oslo.messaging:
assignee: nobody → Gabriele Santomaggio (gsantomaggio)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.messaging (master)

Reviewed: https://review.opendev.org/651765
Committed: https://git.openstack.org/cgit/openstack/oslo.messaging/commit/?id=0ad4a204b385273b671327028d30133725c6174e
Submitter: Zuul
Branch: master

commit 0ad4a204b385273b671327028d30133725c6174e
Author: Gabriele <email address hidden>
Date: Thu Apr 11 13:48:40 2019 +0200

    Consider the topic parameter as an array in client-notify

    Without this fix, the simulator splits the "topic" value in different
    strings, in notify-client case
    Instead of having one queue there are multi-queues.
    See [1] for more details

    Closes-Bug: #1824339

    1- https://bugs.launchpad.net/oslo.messaging/+bug/1824339

    Change-Id: I438c7279d584bdb00da18477a83d5e2a53c588c4

Changed in oslo.messaging:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.messaging 9.7.0

This issue was fixed in the openstack/oslo.messaging 9.7.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.