13 Commits

Author SHA1 Message Date
John Eckersberg
d873c0d8f5 Do not use threading.Event
Waiting on a threading.Event with eventlet can cause busy looping via
epoll_wait, see related bug for more details.

Change-Id: I007613058a2d21d1712c02fa6d1602b63705c1ab
Related-bug: #1518430
2019-12-18 13:11:41 +00:00
Steve Kowalik
7e4ca449a0 Add ConfFixture.transport_url
As the first step towards removing rpc_backend, we need all of the test
fixtures to stop setting/using it via ConfFixture.transport_driver. Add
ConfFixture.transport_url, and move the tests over to setting it rather
than transport_driver.

Partial-Bug: #1712399
Change-Id: I6e2ae2b511fdc52790d5755a9aecaf2f427ab706
2018-06-01 11:45:12 +10:00
Brant Knudson
4531490b05 Remove use of mox stubs
OpenStack projects should be using mock rather than mox.
oslo.messaging was using mox's stubs via oslotest rather than
mock.patch.object. The code is converted to use mock.patch.object
via fixtures.MockPatchObject.

Change-Id: I19490b4e8211c35b237ebfd38bf2f8b8b44cbf61
2017-04-28 18:31:46 +08:00
ChangBo Guo(gcb)
4af9127cb6 Remove usage of parameter enforce_type
We deprecate and change parameter enforce_type's default value
to True[1], so don't need usage enforce_type.

[1] https://review.openstack.org/328692

Change-Id: Ib89cb9bc8afa13e13350e80ec9210ab9e878201f
2017-04-11 14:32:53 +08:00
Brant Knudson
1fb3956f44 Remove self.mox
No tests use this property.

Change-Id: Ifa740e59207a87890bb100cc035ec6088ac03dca
2017-03-07 03:41:16 +00:00
Mehdi Abaakouk
578a186515 kafka: ensure topics are created
Change-Id: I3fb5ee1c134ca6ea220b204af8f6325eeadf9465
2017-01-26 08:00:40 +01:00
Li-zhigang
ea8fad47a5 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators.
We can use dict.items instead, as it will return iterators in PY3 as well.
And dict.items/keys will more readable. 2.In py2, the performance about
list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Ia235afc3532f62f265f91ca46d2306c72fc2a2a2
2016-11-23 09:02:14 +00:00
Gevorg Davoian
d946fb1862 Fix pika functional tests
Change-Id: I05f2cbd914857da7a75ca068e99614156797d1ed
Closes-Bug: #1599777
Depends-On: Ic6acc5d006344e08c219724e488fc9222786d849
2016-08-01 11:03:45 +03:00
Javeme
ca6c34ac71 make enforce_type=True in CONF.set_override
Each config option has limitation for type and value. If we use
method CONF.set_override without parameter enforce_type=True, we
may pass wrong type to config option.

This commit makes sure calling method CONF.set_override with
enforce_type=True.

Change-Id: I1430c93777d6e5d98086a8700663ab9f58c1e5ab
Closes-Bug: #1517839
2016-01-08 13:32:03 +08:00
Matthew Booth
f9b14c0337 Remove unused event in ServerThreadHelper
Change-Id: Ib9ebe363f29cf9a0034550ad852882c2cde8bb49
2015-10-21 11:36:28 +01:00
Mehdi Abaakouk
0dafde9407 Ensures that some assumptions are true.
It's documented, the application consumer must not use wait before stop.
but this is not enforced, so enforce it

Also the code assume start/stop/wait are called from the same thread,
but this is not enforced, so enforce it.

A common broken usage is:

    server = oslo.messaging.get_rpc_server(..., executor='eventlet')
    t = threading.Thread(target=server.start)
    t.daemon = True
    t.start()
    ...foobar code...
    server.stop()
    server.wait()

With monkey patching, start() will do a context switch and then stop()
is called but start is unfinished, that can cause unexpected behavior.

This patch fixes these issues by making all of this explicit.

Closes-bug: #1465850
Closes-bug: #1466001

Change-Id: I0fc1717e3118bc1cd7b9cd0ccc072251cfb2c038
2015-07-30 07:35:06 +02:00
Doug Hellmann
ee31a84719 Update Oslo imports to remove namespace package
Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d
Blueprint: drop-namespace-packages
2015-01-21 21:09:33 -05:00
Doug Hellmann
e55a83e832 Move files out of the namespace package
Move the public API out of oslo.messaging to oslo_messaging. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.

bp/drop-namespace-packages

Co-authored-by: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Change-Id: Ia562010c152a214f1c0fed767c82022c7c2c52e7
2015-01-12 12:50:41 -05:00