This repo was created by accident, use deb-python-oslo.service
instead.
Needed-By: I1ac1a06931c8b6dd7c2e73620a0302c29e605f03
Change-Id: I81894aea69b9d09b0977039623c26781093a397a
Many assertEqual sentences don't follow assertEqual(expected, actual),
this patch fix all of them.
Closes-Bug: 1604213
Change-Id: Ice72233f41d2ee1a32ef1be7ff65a8a2ea19c508
This patch adds a 'restart_method' parameter to Launcher. When set to
'reload' (the default), behavior is as today. If a service chooses
'mutate' then when a SIGHUP is received, mutate_config_files is called
instead of reload_config_files. This means the 'mutable' flag on
options will be respected.
Change-Id: Icec3e664f3fe72614e373b2938e8dee53cf8bc5e
Depends-On: I9bb2ff39dc1ed0a63bd7e7635704b34c53d32d79
I need to tweak the launcher used, as it stands this isn't possible.
Also I find it ugly muddling the service arguments with the
_spawn_service arguments.
Pass in constructors for each of these. This allows us to pass
whatever arguments, set up extra things, whatever we want. It's
important that at least the launcher is created in the child process
so we can't pass in objects.
This patch also fixes Launcher.launch_service to accept a workers
argument (which must be 1 or a ValueError will be raised). This makes
ServiceLauncher.launch_service compatible with
ProcessLauncher.launch_service, avoiding awkward "if isinstance" or
"if workers == 1" logic when you're not sure of the type of the
launcher.
Change-Id: Ia309828c0c7e7599d4b82994dd36165106dc6513
socket.sendall() expects a byte-string as
argument but takes its from _sd_notify in
a string format causing an exception on python3
Closes-Bug: #1564150
Change-Id: I16de988739b9e37b8b2721fefd3c6be485e5a4c7
Instead of using time.time and such directly the
oslo utils timeutils code provides a handy timer that
itself uses monotonic time (so it won't be affected
by time shifts) so prefer to use that for the timer like
code that exists in this new cancel code.
Change-Id: Ie41f8e90cf1cb3f62fd0def00b0bc7068acd2c40
eventlet's hub mechanism defaults to using time.time for figuring
out how long to sleep, when to wake up etc:
https://github.com/eventlet/eventlet/blob/master/eventlet/hubs/epolls.py#L37https://github.com/eventlet/eventlet/blob/master/eventlet/hubs/hub.py#L344
So if you mess with the system time, anything using loopingcall
will stop working. Best example as described in the bug is
`nova-manage service list` which fails for some services when
the clock is advanced.
If we use a monotonic timer, then we can get past this problem.
In this review we use the EVENTLET_HUB hook to specify
a custom Hub. In our custom Hub, we just delegate to the
existing hub mechanism (get_default_hub()) to create an
instance of the Hub and override the clock with one based
on monotonic.
Note that use_hub() mechanism will not work because that sets
the Hub just for the current thread and will not work for other
threads that may be started later. In order to set this
environment variable early, we set it in the __init__.py so
anyone who uses oslo service will enable this support just
by a simple import referencing anything in oslo.service
Co-Authored-By: Victor Stinner <vstinner@redhat.com>
Closes-Bug: 1510234
Change-Id: I4c1cf223e9f6faa1e6dcaf432be1aa709072a343
You can get large tokens when keystone is configured to use PKI
tokens. This doesn't have anything to do with v3 or v2.0.
Change-Id: I8a571a7f6f69c1f68a1991be09db093f91c29367
It turned out that distribution of WSGI requests between forks is not
even when eventlet is used, which can cause pool timeout issues under
load, while there are idle workers with open DB connections, which
should have served these HTTP requests.
The default number of greenthreads in pool should be decreased to allow
DB oriented services (mostly APIs) distribute load more evenly between
workers: one worker will stop accepting new requests, when there are no
more available greenthreads in the wsgi pool, accept() will block, but
there are other forks accept()'ing on the same FD to handle connections
from the queue in kernel.
Related change to oslo.db:
I2e9c2a71d8231e0dfbefc6293ad319e1e459beec
Testing was performed using this script:
https://gist.github.com/zzzeek/c69138fd0d0b3e553a1f
With 100 greenthreads in the pool, 50 DB connections allowed overflow
no pool timeout issues were seen with up to 500 concurrent requests
done by ab, while current default values (1000/10) could not handle
even 100 concurrent requests.
See this ML thread for details:
http://lists.openstack.org/pipermail/openstack-dev/2015-December/082717.html
Closes-Bug: #1535375
Change-Id: I65b40b9906b75146a0085bbe168f1e6bcae82f21
Local files can be made accessible to certain users vs random
ports which can be accessible to anyone on a machine so allow
using unix files as a way to start the eventlet backdoor (so that
user and group permissions common on unix are not lost).
To use this new type of files `socat` is needed (or other way
to interact with telnet over a unix domain socket).
For example (with the path at /tmp/my_special_socket):
socat - UNIX-CONNECT:/tmp/my_special_socket
Depends-On: Ia2385879e09991102f8f305ec41dbb651a4374de
Change-Id: I7f25913168ebe5854f360db3d6310b72a56b2b4d
It seems that since some of the latest eventlet releases (0.18.2
most likely) sock.read() returns a single line, not the whole
response as the tests expected.
There's no discernable reason why we need to use a raw
eventlet-based client TestWSGIServerWithSSL to confirm that a
wsgi server is listening correctly and returning the expected
response, especially since using eventlet leads to unreliable
i/o on the socket unless there is an explicit yield before
asserting the value of the response.
So requests is used to query the servers and verify the response.
Based on the nova review: https://review.openstack.org/#/c/278089
Change-Id: Iff4ea2b00e50f6928a22ac2309e77b8bafade087