Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ansible/module_utils/kolla_podman_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,12 @@ def compare_config(self):
if rc == 0:
return False
elif rc == 1:
self._config_diff = (raw_output.decode('utf-8') if
isinstance(raw_output, bytes) else raw_output)
try:
self._config_diff = (raw_output.decode('utf-8') if
isinstance(raw_output, bytes) else
raw_output)
except UnicodeDecodeError:
self._config_diff = 'container changed during config check'
return True
else:
raise Exception('Failed to compare container configuration: '
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/glance/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
project_services: "{{ glance_services }}"
service: "{{ glance_services['glance-api'] }}"
service_name: "glance-api"
service_uwsgi_config_chunked_input_limit: "{{ '64M' | human_to_bytes }}"
service_uwsgi_config_http_port: "{{ glance_api_listen_port }}"
service_uwsgi_config_log_file_chmod: "644"
service_uwsgi_config_module: "{{ service.wsgi }}"
Expand Down
3 changes: 3 additions & 0 deletions ansible/roles/service-uwsgi-config/templates/uwsgi.ini.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[uwsgi]
add-header = Connection: close
buffer-size = 65535
{% if service_uwsgi_config_chunked_input_limit is defined %}
chunked-input-limit = {{ service_uwsgi_config_chunked_input_limit }}
{% endif %}
die-on-term = true
enable-threads = true
exit-on-reload = false
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/bug-2158974-8a585c20e4dbff1f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixed instance snapshot hanging indefinitely.
`LP#2158974 <https://launchpad.net/bugs/2158974>`__
18 changes: 18 additions & 0 deletions tests/kolla_container_tests/test_podman_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,24 @@ def test_compare_config_changed(self):
user='root')
self.assertTrue(return_data)

def test_compare_config_chenged_unicode_error(self):
self.fake_data['params']['name'] = 'my_container'
self.pw = get_PodmanWorker(self.fake_data['params'])
my_container = construct_container(self.fake_data['containers'][0])
invalid_bytes = b'\x8e\xfe\xfd'
my_container.exec_run = mock.Mock(return_value=(1, invalid_bytes))
self.pw.pc.containers.get.return_value = my_container

return_data = self.pw.compare_config()
self.pw.pc.containers.get.assert_called_once_with(
self.fake_data['params']['name'])
my_container.exec_run.assert_called_once_with(
pwm.COMPARE_CONFIG_CMD,
user='root')
self.assertTrue(return_data)
self.assertEqual(self.pw._config_diff,
'container changed during config check')

def test_compare_config_changed_container_exited(self):
self.fake_data['params']['name'] = 'my_container'
self.pw = get_PodmanWorker(self.fake_data['params'])
Expand Down