This is using python3 from the system and hitting systemd tasks limit

Bug #1998152 reported by Shunde Zhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Prometheus Openstack Exporter Charm
Invalid
Undecided
Unassigned
prometheus-openstack-exporter-snap
Fix Released
Critical
Giuseppe Petralia

Bug Description

This is affecting the snap. It was tested with 0.1.9 latest/edge but should affect also previous releases.

2 issues:

1. python3 symlinks are broken inside the snap, and when installed on bionic it uses python3 from the system (python 3.6)

2. Snap service is hitting systemd tasks limit and then throwing BlockingIOError

Tags: sts

Related branches

tags: added: sts
Revision history for this message
Shunde Zhang (shunde-zhang) wrote :

The new prometheus-openstack-exporter version 0.1.9 (in snap's latest/edge channel currently) requires Python3.8, which is not the default Python on Bionic but it is the default Python on Focal.

# ls -l /snap/prometheus-openstack-exporter/current/bin/
...
lrwxrwxrwx 1 root root 7 Jul 30 12:32 python -> python3
lrwxrwxrwx 1 root root 18 Jul 30 12:33 python3 -> /usr/bin/python3.8

When running on Bionic, it throws a lot of errors in syslog.

Nov 30 06:28:44 juju-34915b-openstack-39 prometheus-openstack-exporter.prometheus-openstack-exporter[8211]: File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
Nov 30 06:28:44 juju-34915b-openstack-39 prometheus-openstack-exporter.prometheus-openstack-exporter[8211]: self.process_request(request, client_address)
Nov 30 06:28:44 juju-34915b-openstack-39 prometheus-openstack-exporter.prometheus-openstack-exporter[8211]: File "/usr/lib/python3.8/socketserver.py", line 603, in process_request
Nov 30 06:28:44 juju-34915b-openstack-39 prometheus-openstack-exporter.prometheus-openstack-exporter[8211]: pid = os.fork()
Nov 30 06:28:44 juju-34915b-openstack-39 prometheus-openstack-exporter.prometheus-openstack-exporter[8211]: BlockingIOError: [Errno 11] Resource temporarily unavailable

To solve that, Python3.8 needs to be installed on Bionic.

apt install python3.8 libpython3.8

However snap doesn't do this, neither does the charm.
So maybe we need to add this to the charm? e.g. if running exporter 0.1.9 on Bionic, the charm should install Python3.8 and its lib.

Revision history for this message
Shunde Zhang (shunde-zhang) wrote :

Looks like 'snap refresh' will break prometheus-openstack-exporter 0.1.9 [1].
I have to restart the exporter service in systemd to bring it back again.

[1] https://pastebin.ubuntu.com/p/2zKJxP9MsQ/

Revision history for this message
Giuseppe Petralia (peppepetra) wrote :

Thanks for reporting this. I am not able to reproduce the BlockingIOError reported, but I have proposed a change to fix the broken symlink for python3 here:

https://code.launchpad.net/~peppepetra/prometheus-openstack-exporter-snap/+git/prometheus-openstack-exporter-snap/+merge/434246

Revision history for this message
Giuseppe Petralia (peppepetra) wrote :

I am able to reproduce the BlockingIOError. This is happening because the exporter uses a ForkingHTTPServer which creates a new thread on each call increasing the tasks count until it reaches the limit and then starts throwing the BlockingIOError.

I have proposed a fix on the same MP:
https://code.launchpad.net/~peppepetra/prometheus-openstack-exporter-snap/+git/prometheus-openstack-exporter-snap/+merge/434246

Changed in charm-prometheus-openstack-exporter:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Giuseppe Petralia (peppepetra)
status: Confirmed → Invalid
Changed in prometheus-openstack-exporter-snap:
importance: Undecided → Critical
Changed in charm-prometheus-openstack-exporter:
importance: Critical → Undecided
assignee: Giuseppe Petralia (peppepetra) → nobody
Changed in prometheus-openstack-exporter-snap:
assignee: nobody → Giuseppe Petralia (peppepetra)
description: updated
summary: - revision 25 not working on bionic
+ prometheus-openstack-exporter snap hitting tasks limit and using python3
+ from the system
summary: - prometheus-openstack-exporter snap hitting tasks limit and using python3
- from the system
+ This is using python3 from the system and hitting systemd tasks limit
Changed in prometheus-openstack-exporter-snap:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.