1558 Commits

Author SHA1 Message Date
Joshua Harlow
0774b5ceba Always delete exc_info tuple, even if reply fails
Avoid any possible references to exc_info tuple by ensuring
we delete it in a finally block, so that even if replying or
logging fails somehow the prior exception is always deleted
correctly.

Change-Id: Id0e5099b9b38b1803bb4514f7cf3deae760d5ac3
2016-03-04 11:52:34 -08:00
Jenkins
5b75f39676 Merge "Simulator: fix batch-notify-server command" 2016-03-04 15:09:03 +00:00
Ilya Shakhat
d2496c34d9 Simulator: fix batch-notify-server command
This patch fixes the name of parameters used to construct
batch notification listener

Change-Id: I8eae9494943b2592c9cf4b92fccca93eab3b8e93
2016-03-02 18:28:11 +03:00
Jenkins
9db1cc728c Merge "Work with kombu from upstream" 2016-03-02 15:04:14 +00:00
Jenkins
363c591ffb Merge "Fail quickly if there on bad password" 2016-03-02 08:54:10 +00:00
Davanum Srinivas
0de6bd6be5 Work with kombu from upstream
Fix a test case that breaks with latest kombu. we mock
the close for the in-memory transport as the newer code
closes connection aggressively (it's doing the right thing)
which ends up with a test failure.

Closes-Bug: #1550630
Change-Id: I8956837a2ecd8ccd858dceac7b99a0f34351603c
2016-03-01 18:11:39 +00:00
Davanum Srinivas
97655c1fe6 Fail quickly if there on bad password
Inspired by:
https://bugs.launchpad.net/oslo.messaging/+bug/1508512/comments/1

Add authentication_failure_close capability on the client to
tell the server that it can send us connection.close command
indicating ACCESS_REFUSED as the reasona. If this capability is
absent then authentication failures are reported in the legacy
fashion: by abruptly closing the network connection.

Partial-Bug: #1508512
Change-Id: Icf6108678256e6f922620837c71f8827fe8e8c52
2016-02-29 18:30:46 -05:00
ozamiatin
76ab2c4f62 [zmq] Dynamic port range is ignored
If we specify the default range to pyzmq function,
means default values are the same as pyzmq default values
we fallback to bind-0 system call which is not appropriate
for us as it binds in maximal range > 1024.

https://github.com/zeromq/pyzmq/blob/master/zmq/sugar/socket.py#L212

Change-Id: Idacd99d83c8fb9ad222a7bda187fa67a9b0348da
Closes-Bug: #1550104
2016-02-29 16:55:35 +02:00
Jenkins
ed84711596 Merge "[zmq] Implement Response and Envelope classes" 2016-02-27 16:14:33 +00:00
Javeme
c721265231 [zmq] Implement Response and Envelope classes
Currently we get a property from zmq reply/envelope through a dict
operating, for more easily accessing its properties, let's add
Response and Envelope classes and reduce dicts in our messages.

This patch will make the code more concise such as:
  reply[zmq_names.FIELD_FAILURE] => reply.failure

Change-Id: I9ca7e4bee404ca8e658163827d958b69b05a16ae
2016-02-27 13:49:23 +08:00
Jenkins
f9ccc2a122 Merge "[kafka] Use notification priority" 2016-02-26 23:07:52 +00:00
Jenkins
cb8b54a6fd Merge "Adds exhange declaration on sender's side" 2016-02-26 16:45:35 +00:00
Oleksii Zamiatin
71450fac34 [kafka] Use notification priority
Notification priority actually points to an endpoint method
to be called and couldn't be ignored by the driver.

Also reduced exchange because it shouldn't take part in
final topic resolution.

Closes-Bug #1546081

Change-Id: I4a7c367d91c2fefc6830f0ab3cdcbc0b605127b0
2016-02-26 16:17:31 +02:00
ozamiatin
681f631123 Make simulator more asynchronous
We need to use eventlet.sleep() in green thread loops
in order to have more chances to switch between them.

Change-Id: I7c08e82182b68b95c36265d58df0644c5ce2c171
2016-02-26 13:15:00 +02:00
dukhlov
89cc47ec4a Adds exhange declaration on sender's side
When you send message to exchange which is not exist current
channel is closed and you need to reconnect. This is undesired.
Also this patch separate sending fanout message and call/cast
messages and don't raise exception if exchange doesn't exist
for fanout messages.

Change-Id: Ia556d0c1b219387892007925bb437664aaaccb69
2016-02-26 13:08:01 +02:00
OpenStack Proposal Bot
a95035c264 Updated from global requirements
Change-Id: I558ae8577fba6feeb393b4c193e39747318809a9
2016-02-26 01:52:26 +00:00
Jenkins
a1cd433687 Merge "amqp: log time elapsed between receiving a message and replying" 4.5.0 2016-02-25 18:05:07 +00:00
Jenkins
b2f68cc34f Merge "[zmq] Matchmaker redis set instead of list" 2016-02-25 18:05:01 +00:00
Jenkins
d8c7c8f2c0 Merge "Fix a minor syntax error in a log statement" 2016-02-25 17:28:10 +00:00
Jenkins
f4560ecf2a Merge "Allow Notifier to have multiple topics" 2016-02-25 17:16:40 +00:00
Jenkins
55587cc4e2 Merge "Use PortOpt on kafka_default_port" 2016-02-25 15:42:23 +00:00
John Eckersberg
12e27800b0 amqp: log time elapsed between receiving a message and replying
Change-Id: I1e64587cb76fe449fd0d60f78e830dc603574af5
2016-02-25 09:30:29 -05:00
ozamiatin
02135bc1f4 [zmq] Matchmaker redis set instead of list
No need to check element before push.

Change-Id: Ic4b5ff829d0d94a35aaab1af8ff6991a0b5cebe6
Related-to: I25d623eb4bb0a827daa8a316a0ddcb4a473f8694
2016-02-25 13:01:26 +02:00
Davanum Srinivas
2d53db6c51 Allow Notifier to have multiple topics
Looks like there is a disconnect between the __init__
parameter 'topic' in Notifier and what we need when
we look up a driver. We should allow multiple topics
to be specified as a new topics parameter and pass
that along directly.

Change-Id: Id89957411aa219cff92fafec2f448c81cb57b3ca
2016-02-25 06:43:00 +00:00
Kenneth Giusti
f868936d66 Fix a minor syntax error in a log statement
Change-Id: If6115045dbaf2229b1229d259787ecd207348603
2016-02-24 16:02:32 -05:00
Jenkins
a17e42d5cf Merge "Improves poller's stop logic" 2016-02-24 20:05:10 +00:00
Eric Brown
1911828638 Use PortOpt on kafka_default_port
The oslo.config lib includes a PortOpt to simply restrict the
range of integers available for a port type option. This patch
makes use of that.

Change-Id: I8cda92d6c7555b6cb788627d072174ad608fb6de
2016-02-24 18:37:23 +00:00
Jenkins
7a537b2c60 Merge "Added duration to notify server/client" 2016-02-24 17:45:18 +00:00
Jenkins
e133c7e863 Merge "Use more efficient mask_dict_password to mask password" 2016-02-24 15:26:06 +00:00
Yulia Portnova
d70dfc2f7e Added duration to notify server/client
Change-Id: I4feeeec0c69305d92dce5baf60502a39ebe6b247
2016-02-24 11:58:12 +03:00
dukhlov
f93e162912 Improves logging
This patch change log string formatting approach,
moves it inside logging method to avoid formatting if
it is not needed for given log level

Change-Id: Ice73f2fc893701544cadc75bafd6833de0ae5d51
2016-02-24 07:15:58 +00:00
Javeme
3288c4d7e2 Use more efficient mask_dict_password to mask password
The mask_dict_password method is added from oslo_utils 3.4.0, and it's
about five times faster than the mask_password method, so it's better
to use mask_dict_password instead of mask_password.

Change-Id: I6629ed1232f2e6f1c72b9f13b361e2f9e14b50a4
2016-02-24 13:19:53 +08:00
Jenkins
339a6236b3 Merge "Typos of 'recieve' instead of 'receive'" 2016-02-24 03:36:28 +00:00
Jenkins
7e02e4803c Merge "Documents the mirror queue policy of RabbitMQ 3.0" 2016-02-24 03:36:22 +00:00
Jenkins
f848a56727 Merge "Reduce number of rabbitmq consumer tag used" 2016-02-24 03:36:12 +00:00
Jenkins
629632bfff Merge "Get kafka notifications to work with kafka-python 0.9.5" 2016-02-23 21:40:27 +00:00
dukhlov
4e1b813fe3 Improves poller's stop logic
This patch add sending cancel request to RabbitMQ
and inform it to stop message sending to the poller.

It makes listener stop/wait procedure more graceful

Change-Id: Ibadb5f705f6ea4ef32969a69d1db68ada1f491e4
2016-02-23 21:05:39 +00:00
Jenkins
f0cf534dfc Merge "Avoid hardcoding the notification topic and specify driver" 2016-02-23 20:48:14 +00:00
Jenkins
d16b944865 Merge "[zmq] Support transport URL" 2016-02-23 19:09:00 +00:00
Jenkins
a89321f251 Merge "Move server's logic from executors" 2016-02-23 18:52:04 +00:00
Eric Brown
5fd3b1509b Typos of 'recieve' instead of 'receive'
* i before e unless before c
* Also updated the docstring on consume function

Change-Id: Icfe35fc577d01434839d6774d02b933fc4cd1a08
2016-02-23 09:18:13 -08:00
Jenkins
a66677da50 Merge "Remove duplicate requirements" 2016-02-23 17:01:08 +00:00
Oleksii Zamiatin
fda27b0899 [zmq] Support transport URL
Opposite to central-broker transport in zmq we
don't have such, but we can use transport URL
to pass credentials to redis (or other registry) for example.

Closes-Bug #1538095

Change-Id: I58069a20c129bab4a25fd17add9eb9c428fe3ff3
2016-02-23 16:34:19 +00:00
Davanum Srinivas
b97950ea38 Get kafka notifications to work with kafka-python 0.9.5
* poll() now returns empty list instead of None
* metadata_broker_list has been dropped, there's a new
  bootstrap_servers
* Add a LOG.debug() for the actual message

python simulator.py -d DEBUG --topic notifications.info --url kafka://localhost:9092 notify-server
python simulator.py -d DEBUG --topic notifications --url kafka://localhost:9092 notify-client -m 1000 -w 1

More tips:
http://kafka.apache.org/documentation.html#quickstart
https://www.digitalocean.com/community/tutorials/how-to-install-apache-kafka-on-ubuntu-14-04

Depends-On: Ia324b4c89b05c536708baf7950857cd159578cec
Change-Id: I80911d2678ea5e8d0cd6b146a1e29a58858e3144
2016-02-23 15:21:06 +00:00
dukhlov
1482687ff7 Move server's logic from executors
Now we have situation when openstack projects like Mistral needs
extra oslo.messaging functionality.

 But it is too complicated now to to implement something new and
 integrate it with current code because there is a little bit mess.
 1) Executor should be responsible for how to run jobs
      (but now also has code with server logic)
 2) Dispatcher should be responsible for routing message to the
     target endpoint for processing (but it also has serialisation, sending replies,
     executing some executor's callbacks etc)
 3) Server should do all server specific logic, we need to have different
      implementation of servers for RPC and notification, not different implementations
      of dispatchers

 This patch fixes 1-st point

Change-Id: Ib6408f408889bb7b7056722be636a5547b1a780d
2016-02-23 15:00:58 +00:00
Davanum Srinivas
11f78de5f0 Avoid hardcoding the notification topic and specify driver
"n-t1" as notification topic not really useful. Let's allow
it to be specified from the command line. Also make sure
we set the notification driver as "messaging" by default

Change-Id: I5daf09b9a01e4d642b0f53d7634d5b305d5a82cb
2016-02-22 16:07:30 -08:00
Jenkins
92c4f76c79 Merge "Py3: Replace filter()/map() if a list is needed" 2016-02-22 16:02:17 +00:00
Jenkins
bf6555d9d6 Merge "[zmq] Fix cinder create volume hangs" 2016-02-22 14:55:18 +00:00
Oleksii Zamiatin
8600f081e7 [zmq] Fix cinder create volume hangs
Cinder create volume hangs in default deployment devstack+zmq.

* Fix general topic resolution in matchmaker
* Fix matchmaker redis to use set instead of list

Change-Id: I25d623eb4bb0a827daa8a316a0ddcb4a473f8694
Closes-Bug: #1546106
2016-02-22 13:51:52 +02:00
Javeme
1561fbb3cc Py3: Replace filter()/map() if a list is needed
-- "cls.scenarios = filter(f, cls.scenarios)"
It's better to set a list to cls.scenarios but filter()/map() returns
an iterator on Python 3. This patch we replaced the filter()/map() with
a list comprehension in test_server.py.

Change-Id: I16640e564d41c6a1c29e229049467ae788bb1437
2016-02-22 14:53:57 +08:00