1087 Commits

Author SHA1 Message Date
gord chung
7fe91cc01a fix batch handling
for some reason there are two timeouts. in the batch scenario,
all the time wasted waiting on initial 'get' is never accounted
for so the batch timeout is always longer than it is declared.

Change-Id: I6132c770cccdf0ffad9f178f7463288cf954d672
2017-11-12 13:43:48 -05:00
Ben Nemec
d925e112b5 Flesh out transport_url help
This is a complicated config opt and the single line help text
doesn't provide anywhere near enough detail for a user to properly
configure it.  This change adds the expected format from the
TransportURL docstring and leaves a link to the docs for that
class since the full details are probably too verbose to put in the
help text in their entirety.

Change-Id: I66122bf9c619d35bcb3caadfde9c0dcdb5cd9095
2017-10-06 20:04:34 +00:00
Jenkins
a9d10d33cd Merge "Fix default value of RPC dispatcher access_policy" 2017-09-26 14:19:54 +00:00
zhangxuanyuan
3a9c01ffe9 Fix default value of RPC dispatcher access_policy
Change-Id: I4d30ff269b2e34f4409e8d1ce822eb93918cf5a2
Closes-Bug: #1712393
2017-09-24 20:25:38 -07:00
Rajath Agasthya
6efa86a8d5 Fix wrong transport warnings in functional tests
Change-Id: Ie6726ecd566d965a94343bde7a518e986b434346
Closes-Bug: #1718691
2017-09-22 17:13:26 -07:00
Jenkins
393ecff345 Merge "Warn when wrong transport instance is used" 2017-09-15 18:33:29 +00:00
Rajath Agasthya
03b6f18f80 Warn when wrong transport instance is used
Since RPC and notifications can have different backends, it is
useful to warn users if they use a notification transport in RPC
and vice versa. This patch introduces RPCTransport and
NotificationTransport subclasses of Transport, so it's easier to
add different behavior for them if need be.

Related-Bug: #1680192
Change-Id: Iab60544d69053c8e74c28a2d5c84665be749013f
2017-09-11 07:07:30 -07:00
Jenkins
6bbb3bc09d Merge "Class-level _exchanges in FakeExchangeManager" 2017-09-08 07:10:45 +00:00
Jenkins
809d4a54f1 Merge "Fix some reST field lists in docstrings" 2017-09-08 05:07:28 +00:00
Jenkins
338b85eb4e Merge "Suppress excessive debug logs when consume rabbit" 2017-09-07 23:24:51 +00:00
lingyongxu
d7229a124f Fix some reST field lists in docstrings
Probably the most common format for documenting arguments is reST field
lists [1]. This change updates some docstrings to comply with the field
lists syntax.
[1] http://sphinx-doc.org/domains.html#info-field-lists

Change-Id: Ifa8c0db3efc03eac3b034ef642aaa8fce514a66e
2017-09-07 05:42:45 +00:00
Jenkins
ff905655e9 Merge "Add support for virtual hosts" 2017-09-07 03:27:50 +00:00
Zhen Qin
147186c7b4 Suppress excessive debug logs when consume rabbit
If using rabbitmq as rpc backend, oslo.messaging generates large amount
of redundant timeout debug logs (several logs per second on multiple
openstack services, such as nova, heat, cinder), in format of 'Timed out
waiting for RPC response: Timeout while waiting on RPC response - topic:
"<unknown>", RPC method: "<unknown>" info: "<unknown>'. It's because
each socket timeout exception is raised to multiple levels of error
recovery callback functions then logged repeatedly.

However, the accompanying value of socket.timeout exception is currently
always “timed out”. Besides, oslo.messaging has implemented retry
mechanism to recover socket timeout failure. Therefore, IMO those logs
should be suppressed, even if at debug level, to save disk space and
make debugging more convenient.

Change-Id: Iafc360f8d18871cff93e7fd721d793ecdef5f4a1
Closes-Bug: #1714558
2017-09-06 21:35:33 -04:00
Jenkins
ba30a3067d Merge "Ensure RPC endpoint target attribute is correct" 2017-08-29 00:13:48 +00:00
Jenkins
01098406df Merge "Remove envelope argument from driver send() interface" 2017-08-27 15:19:35 +00:00
Rajath Agasthya
d15a6deb17 Remove envelope argument from driver send() interface
It is ignored by most drivers and hardcoded to True in the rabbit
driver

Closes-Bug: #1712877
Change-Id: Ic6b0d07bff3c544aca4cccdfcb4c59b8705e9128
2017-08-25 08:17:47 -07:00
OpenStack Proposal Bot
f74328c63b Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Id9d500ffac34e52a246cbc00cd6c3e5f9efe979e
2017-08-24 08:19:48 +00:00
Jenkins
6f992dfc7f Merge "Prevent rabbit from raising unexpected exceptions" 2017-08-22 16:44:22 +00:00
Jenkins
2e61438d2e Merge "Remove unnecessary setUp function in testcase" 2017-08-21 15:27:50 +00:00
Kenneth Giusti
f059bba6ae Prevent rabbit from raising unexpected exceptions
Publishing a message using the kombu connection autoretry method may
allow exceptions from the py-amqp library to be raised up to the
application. This does not conform to the documented oslo.messaging
API.

Enhance the try except block to capture any exception and translate it
into a MessageDeliveryFailure.

There are a few cases where exceptions will be raised during autoretry
publishing: recoverable connection or channel errors, and
non-recoverable connection or channel errors.

autoretry will only retry if the error is recoverable. Non recoverable
errors are re-raised immediately regardless of the retry count.

In the case of a recoverable error it seems unlikely that retrying
either the connection or the channel yet again is going to get us
anywhere, so in this case we simply clean up the channel state, log an
error and fail the operation.

In the case of non-recoverable error we are out of luck (think
authentication failure) - further retrying will not help.  Best we can
do is clean up state and log the heck out of it.

Change-Id: I2f65d2ee19a8c3e9a323b30404abbf0cbb45a216
Closes-Bug: #1705351
Closes-Bug: #1707160
2017-08-21 09:36:39 -04:00
liuyamin
80c6283361 Remove unnecessary setUp function in testcase
In testcase, setUp will be called automatically. This patch used
to remove setUp functions that do nothing. Besides, it will keep
code clean.

Change-Id: I2bf79884704974dc00196816f7de43580b474d3e
2017-08-18 01:22:26 +00:00
Kenneth Giusti
b7382d58d7 Ensure RPC endpoint target attribute is correct
An endpoint can have an optional 'target' attribute which is used to
filter the callable endpoint by the target.version or .namespace
attributes.  Therefore 'target' is reserved and attempting to use an
endpoint that overrides the target attribute (say with a function
call) should fail with a TypeError.

Change-Id: I0bbf9fca0ecbe71efa87c9613ffd32eb718f2c0e
Closes-Bug: #1709131
2017-08-16 12:00:46 -04:00
lidong
b3b1ae1926 Fix a typo
Change-Id: Ie5cb0366804163309f573ca5a2bf5b129c3a8e9b
2017-08-10 01:10:47 +00:00
dparalen
d1dac1c11d Class-level _exchanges in FakeExchangeManager
The FakeExchangeManager uses an instance-level storage for FakeExchanges
mapping[1].  When a client--server pair is created, each keeps their own
instance of FakeDriver -> FakeExchangeManager -> FakeExchange, each of
which has their own (instance-level) copy of e.g _server_queues[2], making
it impossible for them to communicate.

This patch makes the _exchanges mapping a class-level attribute in order
to keep the registered exchanges shared between all Manager instances,
allowing client and server communication (within a single process).

The test_server unit-tests had to be refactored to explicitly pass an exchange
name when building a target. This is required for an exchange name change to
have any effect during a test case run time when compared to passing the
exchange name through the URL. This issue was revealed with this patch.

[1] https://github.com/openstack/oslo.messaging/blob/master/oslo_messaging/_drivers/impl_fake.py#L145,#L148
[2] https://github.com/openstack/oslo.messaging/blob/master/oslo_messaging/_drivers/impl_fake.py#L88,#L92

Change-Id: I8dff66f4cafeb1f4c57dbfbfaba5d49e50f55fee
Closes-Bug: #1714055
2017-08-02 08:23:34 +02:00
Kenneth Giusti
263dce9ea8 Add support for virtual hosts
Adds the 'pseudo_vhost' option which when enabled will incorporate the
virtual host into the address semantics.  This creates a 'subnet' like
address space for each virtual host.  Use this when the messaging bus
does not provide virtual hosting support.  It is enabled by default as
to date none of the supported AMQP 1.0 message buses natively support
virtual hosting.

It also updates SSL support: SSL can either use the connection
hostname or the vhost name when validating a server's
certificate. This is controlled by the 'ssl_verify_vhost' option.
This option is disabled by default as it requires both vhost and SNI
support from the server.  By default SSL will use the DNS name from
the TransportURL.

Change-Id: I49bb99d1b19e8e7e6fded76198da92ca5f7d65ab
Closes-Bug: #1700835
Partial-Bug: #1706987
2017-07-28 16:37:26 -04:00
Kenneth Giusti
2c9ac202eb Remove the test that counts kombu connect calls
This test removes a check of the number of times kombu's
Connection.connect() method is being called for each mocked retry.
The number of calls kombu makes internally is irrelevant to proving
the API is correct.  The rest of the tests do ensure that the target
method is retried as expected, which is relevant to the API.

This change is necessary due to the kombu v4.1.0 release actually
calling Connection.connect() twice for each call to the target method
when compaired to earlier releases.

Change-Id: I3326b8e92efe3bef00b1f389d81944af9cc080f8
Closes-Bug: #1707263
2017-07-28 14:08:32 -04:00
Jenkins
78b698af28 Merge "Add monkey_patch to demo code." 2017-07-13 06:10:43 +00:00
ChangBo Guo(gcb)
60f9989920 Update URLs in documents according to document migration
Change-Id: I139d4d38e49590d50e51495b6e3b84836975c6ed
2017-07-12 22:54:02 +08:00
zhiCHang1990
1389893dd0 Add monkey_patch to demo code.
The RPC server code can not work if we
don't add eventlet.monkey_patch() at the
begining.

Change-Id: I65a162a427fb5615c95a70e6d1bbec899a78f231
2017-07-11 09:45:08 +08:00
Andrew Smith
eccdea5ceb Add kafka_driver directory
Make uniform with other drivers, kafka driver files, etc.

Change-Id: I6c6e201c304a6005ef191f96e5ac39ffaf4ab8f7
2017-06-13 08:46:50 -04:00
Mehdi Abaakouk
8ee5ae135a Fix rabbitmq driver with blocking executor
We recently move ack/requeue of messages in main/polling thread
of rabbitmq drivers. And break the blocking executor.

This one is not tested by any tests and now deprecated.

This change workaround the issue until we completely remove the
blocking executor.

Change-Id: Id479100f6ff364cf67a199e9b70f9f0c7bf7e1a9
Closes-bug: #1694728
2017-06-08 14:15:15 +02:00
Jenkins
aaaf58269c Merge "deprecated blocking executor" 2017-06-06 07:04:35 +00:00
Kenneth Giusti
1642071feb Fix serializer tests
The serializer tests occasionally fail since the order of a dict() is
not guaranteed.  Explicitly compute the serializer instead of
pre-computing it.

Change-Id: I74f8fa227e6508491b5982fe7e2841683724540c
2017-06-05 14:14:56 -04:00
Mehdi Abaakouk
2566be199a deprecated blocking executor
Using blocking executor is not recommended for application. But it looks
like some use it just because it's the default and are not aware their
should change it despite of documentation and logging message.

Choosing the application threading model is an important step
of an application.

This change deprecates it, in the future we will just make executor
mandatory. This will ensure that application make a choice.

Also this will reduce headache of oslo.messaging developers to
make the driver code working in a sync and async.

And to finish test coverage of blocking executor is 0%...

This rework some tests to remove logging.captureWarnings() that can
catch unwanted warning of other tests. Tests mocks warning instead.

Related-bug: #694728
Change-Id: Ic67164d12e7a9bed76d6e64ca2ced12e3984ff5f
2017-06-04 14:27:41 +02:00
Jenkins
8b44bfd538 Merge "Clean up the TransportURL documentation" 2017-06-02 12:58:42 +00:00
Kenneth Giusti
c7d880c33a Clean up the TransportURL documentation
Be specific regarding which characters can be used in the 'username'
and 'password' fields of the URL.

Change-Id: I9a2a801b3dd86fceffb05f4d52c715748c88d0cb
Closes-Bug: #1693967
2017-06-01 15:43:03 -04:00
Kenneth Giusti
c35fb276ce Mark the Pika driver as deprecated
The Pika driver was intended to be a more stable and performant
replacement for the default rabbit driver.  However due to lack of
both maintainers and compelling evidence that pika is superior to the
existing rabbit driver in either performance or stability it has been
deprecated for removal.

See:
http://lists.openstack.org/pipermail/openstack-dev/2017-May/116679.html

Change-Id: I98e0123edd3248be665325833283689fc3a897f7
2017-05-30 13:21:23 -04:00
Jenkins
46f9648261 Merge "rabbit: restore synchronous ack/requeue" 2017-05-22 15:28:34 +00:00
Mehdi Abaakouk
da02bc2169 rabbit: restore synchronous ack/requeue
In https://review.openstack.org/#/c/436958, we fix a thread safety
issue. But we make the ack/requeue of message asynchronous. In nominal
case, it works, but if network/rabbit connection issue occurs this
can result to rpc call handle twice. By chance we double check already
processed message ids, and drop duplicates, but that if the message
goes to another node, the mitigation won't work.

This restore the previous behavior, to ensure we run application
callback of rpc.call/rpc.cast only when the message have been
successfully ack.

Change-Id: I62b9e09513e3ebfebc64a941d4b21b6c053b511d
2017-05-21 11:42:41 +02:00
Jenkins
6feb4a6f54 Merge "Add get_rpc_transport call" 2017-05-17 10:09:26 +00:00
Jenkins
db01a0eec0 Merge "[AMQP 1.0] if RPC call is configured as presettled ignore acks" 2017-05-17 05:02:52 +00:00
Jenkins
b53667675a Merge "[AMQP 1.0] Properly shut down test RPC server" 2017-05-16 15:09:10 +00:00
Jenkins
5e194ca77a Merge "Fix the amqp1 SSL test CA certificate" 2017-05-15 19:00:49 +00:00
Kenneth Giusti
62b8ac6462 [AMQP 1.0] Properly shut down test RPC server
Otherwise the test server will hang attempting to re-connect
indefinitely.

Change-Id: I338a2f9fff4dfe08184a6476a6c47746646f63b8
2017-05-15 13:04:32 -04:00
Kenneth Giusti
12dafbb752 Fix the amqp1 SSL test CA certificate
The certificate was not being generated correctly on xenial.

Change-Id: I997d89d614957b2fb39256e98e62b68e034f09f1
2017-05-12 13:12:48 -04:00
Andrew Smith
ec4d6639bc Add get_rpc_transport call
The get_rpc_transport wraps get_transport to unify the API in
anticipation of comprehensive separation of RPC and Notification
messaging backends.

Related-Bug: 1680192
Change-Id: Ic6af07b98ff43806c2af38a3ba129991f1e0ec86
2017-05-12 12:30:41 -04:00
Kenneth Giusti
8f5cfda664 Disable AMQP 1.0 SSL unit tests
Something broke in the way SSL certs are generated. Disable these
tests for now to unblock the gate.

Change-Id: I9764da7995c198597661ecbea27efba9f76e53e3
2017-05-12 11:11:50 -04:00
Jenkins
e569c92cd9 Merge "Fix notification tests not unmocking logging" 2017-05-03 20:29:40 +00:00
Jenkins
c8ee259bac Merge "Retry support for oslo_messaging_notifications driver" 2017-05-02 04:02:06 +00:00
Jenkins
8e5e5ab218 Merge "Remove use of mox stubs" 2017-04-28 17:47:53 +00:00