The greenlet library is not always used. It is used to capture detail
of green threads but this part can be skipped in case greenlet is not
present.
Also eventlet in test requirements is not used and can be removed.
Change-Id: I57edfe4d975ce42ca92a9242d4b32e69d1cec268
Some services such as nova introduced GMR for API wsgi application
so that GMR can be generated via a file handler. However the current
setup method tries to register signal handler and causes warnings.
For example we are seeing the following error when starting nova-api
by apache + mod_wsgi.
mod_wsgi (pid=80323): Callback registration for signal 12 ignored.
File "/var/www/cgi-bin/nova/nova-api", line 52, in <module>
application = init_application()
File "/usr/lib/python3.9/site-packages/nova/api/openstack/compute/wsgi.py", line 20, in init_application
return wsgi_app.init_application(NAME)
File "/usr/lib/python3.9/site-packages/nova/api/openstack/wsgi_app.py", line 128, in init_application
init_global_data(conf_files, name)
File "/usr/lib/python3.9/site-packages/nova/utils.py", line 1122, in wrapper
return func(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/nova/api/openstack/wsgi_app.py", line 105, in init_global_data
gmr.TextGuruMeditation.setup_autorun(
File "/usr/lib/python3.9/site-packages/oslo_reports/guru_meditation_report.py", line 152, in setup_autorun
cls._setup_signal(signal.SIGUSR2,
File "/usr/lib/python3.9/site-packages/oslo_reports/guru_meditation_report.py", line 185, in _setup_signal
signal.signal(signum,
This introduces the new argument so that we can disable signal handler
completely to avoid such warnings.
Change-Id: I95170542fecb493260a22d9148f3a2777207cb0e
When the config contains a DictOpt that accepts integer keys, the Guru
Meditation Report fails to serialize. Even if current OpenStack code
might not contain such dicts, it's possible that downstream add such
options. Therefore, we change the code to support both dicts with only
integer keys and - just in case - mixed-key dicts.
Change-Id: I44343a8c306c96fc8dc078a76e744cf8b897d8d8
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Remove hacking and friends from lower-constraints, they are not needed
for installation.
Change-Id: I76369aad2778418182eab7c3eaf331b8d6b8fb1d
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I0ec3d1c0f53bf859ea1ec115ebb47f1d5f3b217c
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Resolve the following deprecation warnings on Python 3.x:
DeprecationWarning: Using or importing the ABCs from 'collections'
instead of from 'collections.abc' is deprecated since Python 3.3,and
in 3.9 it will stop working"
Note that even though we're in Ussuri, I've kept this Python 2
compatible since we haven't done all the other work to mark this
package as Python 3-only.
Change-Id: Iff4cf1871a6a91d91da03d9b79ef61e715a979cf
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Because we added the default config_source opt in oslo.config, it
is now showing up in the GMR output and needs to be included in the
expected content. However, for lower constraints testing we also
need to continue to support the older versions without config_source,
so the target_str is built dynamically based on whether the opt
exists.
Change-Id: I20b01285000ce84b69e8bd3cee8078edf03616f8
oslo.reports requires psutil at least to be 3.x, so the compat
code paths for 1.x can be removed safely.
Change-Id: If5de0051f2cd131db2f2b0b2919082e1623c29aa
In case if application is under Apache+mod_wsgi it is not recommended to
use signals [1]. We need to have configuration option for handling
'touch file' event instead of signal.
Alternative solutions:
1) watchdog: can monitor only directories, has issues with eventlet [2].
2) inotify: works only with linux-based systems.
[1]
https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIRestrictSignal
[2] https://github.com/gorakhargosh/watchdog/issues/332
Change-Id: I6ef02457f21da8e6fbd50e57bfa503b3c31ddd76
Implements: blueprint guru-meditation-report-file-touch
Follow new infra setup for translations, see spec
http://specs.openstack.org/openstack-infra/infra-specs/specs/translation_setup.html
for full details.
This basically renames
oslo.reports/locale/oslo.reports.pot to
oslo_reports/locale/oslo_reports.pot. For this we need to update
setup.cfg.
Update also domain name in i18n.py.
The project has no translations currently, let's remove the outdated
pot file, the updated scripts work without them. So, we can just
delete the file and once there are translations, an updated pot file
together with translations can be imported automatically.
Change-Id: Id9b9865ee17375290357887077d3230a3e4ff949
In case run() method fails, all we get is a terse "Unable to run Guru
Meditation Report!" message on stderr.
This patch also prints the traceback for easier debugging in the
unlikely event that GMR fails.
Change-Id: I99d4e0f1ed3ea608aa285f34314339b0939c5651
The object that is passed to signal handler functions is a frame object.
Traceback is the name of a built in module. Let's be clear.
Note that there are other places in the code where this unfortunate
naming happened, like in the keyword argument of the TextGuruMeditation
__init__ method. We can't really change that one as it's part of the
public API.
Change-Id: I11ca5cba3475a82a35c8e9fdb82e2529e5fa7b74
In I9d3b6079ba2cca41fe4723723a6f80b2c3c0b9c0, we broke backward
compatability when we switched from SIGUSR1 to SIGUSR2. This breaks
grenade jobs (Example https://review.openstack.org/#/c/238479/).
So for now, let's register both SIGUSR1 and SIGUSR2 and trigger a
warning in the log that SIGUSR1 has been deprecated. We should
remove use of SIGUSR1 in the O release. Hopefully this does not
break anything as when running under mod_wsgi SIGUSR1 is just
ignored (and SIGUSR2 will work) and both signals will work
under eventlet.
Closes-Bug: #1510740
Change-Id: I54ba70557f441fbd10eb085f79d594a9a33e1f11
Currently the setup_autorun() method expects the user-defined signal,
SIGUSR1, to generate Guru Meditation Report upon killing a Nova Compute
process, while supplying the said signal.
However, testing in a DevStack environment, manually attempting to kill
a Nova Compute process with SIGUSR1 [kill -s USR1 `pgrep nova-compute`]
does not result in the process being terminated, and no error report is
generated.
It turns out[*] that SIGUSR1 is used by Apache 'mod_wsgi'.
Using, the other user-defined signal, SIGUSR2 resolves this issue (i.e.
'nova-compute' process is terminated, and the Guru Meditation Report is
generated successfully).
So, use the signal USR2 instead of USR1. Also, update the corresponding
tests.
DocImpact: With this patch merged, to generate a successful Guru
Meditation Report, supply the signal USR2 while killing a
Nova Compute process [`kill -s USR2 `pgrep nova-compute`].
[*] https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIRestrictSignal
Change-Id: I9d3b6079ba2cca41fe4723723a6f80b2c3c0b9c0
If projects choose to have their own config parameter, they
can use setup_autorun's log_dir parameter. if they want
to let oslo.report's manage the configuration, they will
have to call set_defaults and then use setup_autorun's
conf parameter.
Change-Id: I9ed0191628f2d552acd8130687b636671bc07a3e
psutil 2.x and above has a lot of API changes as described in:
https://github.com/giampaolo/psutil/blob/master/HISTORY.rst
So we should work correctly with both old and new psutil versions
by using a version check and use the correct method/attributes.
Note that we cannot remove the g-r cap until all the projects have
switched to oslo.reports (OR we fix oslo-incubator GMR code and have
sync'ed all the consuming projects). So this review is the first
step in a long process of switching all consumers of GMR to use
what we have in oslo.reports.
Depends-On: I0f07858e96ea3baf46f8a453e253b9ed29c7f7e2
Depends-On: I33bd2d9dff9cb7dc1a50177db7286b7317966784
Closes-Bug: #1430231
Change-Id: I52bc6898d098f599c12204fc6d6eb269e2c884cb
The versions from many openstack projects don't provide the
vendor_string,product_string,version_string_with_package.
We need to keep compatible with these projects.
Closes-Bug:#1456465
Change-Id: I688ef29b84541d3261f6b9395b3f591b276aa071
(cherry-picked from oslo-incubator commit
14874b8a836b9580a94a118ed535898cfa76362f)
Both py27 and py34 jobs fail intermittently and i can
recreate the problem even in my local environment by
repeatedly running "tox -e py27,py34". Fixing up the
sort order helps fix the this issue.
Change-Id: I680c8e986af9177c759740ecb8b94b288386c1bf
Previously, `str()` was used to convert things into strings.
This will not work for unicode messages in Python 2, so
everything was converted to using `six.text_type` instead.