Univention Bugzilla – Bug 56198
Handle aborted long running requests in requests to UMC modules
Last modified: 2023-08-02 11:32:29 CEST
If long running requests are aborted e.g. because of connection timeouts (by apache) those requests aren't detected as aborted in the UMC-Server and therefore the request to the UMC module is still waited for until completion and prevents session timeout for that module. To make UMC behave like before we should detect aborted requests and close the connection to the module process, so that modules can run into session timeout and exit itself.
Easy to test and reproduce via: ucr set umc/module/timeout=30 systemctl restart univention-management-console-server touch /var/run/univention-appcenter.lock curl http://Administrator:univention@localhost:8090/command/appcenter/keep_alive -X POST ^C # after some seconds just exit that request pgrep -fl 'univention-management-console-module.*appcenter' # should run tail -f /var/log/univention/management-console-{module-appcenter,server}.log & sleep 31 pgrep -fl 'univention-management-console-module.*appcenter' # should not run anymore
univention-management-console.yaml 2319287ada50 | fix(umc): handle connection timeouts during requests to UMC modules univention-management-console (12.0.31-2) 2319287ada50 | fix(umc): handle connection timeouts during requests to UMC modules
python-univention-management-console (12.0.31-2) wird eingerichtet ... SyntaxError: 'return' with argument inside generator (resources.py, line 272) dpkg: Fehler beim Bearbeiten des Paketes python-univention-management-console (--configure): »installiertes python-univention-management-console-Skript des Paketes post-installation«-Unterprozess gab den Fehlerwert 101 zurück
(In reply to Arvid Requate from comment #3) > python-univention-management-console (12.0.31-2) wird eingerichtet ... > SyntaxError: 'return' with argument inside generator (resources.py, line 272) > > dpkg: Fehler beim Bearbeiten des Paketes > python-univention-management-console (--configure): > »installiertes python-univention-management-console-Skript des Paketes > post-installation«-Unterprozess gab den Fehlerwert 101 zurück Oh, yes, thanks. I used that occurrence to remove all Python3-only used modules from the Python 2 package and migrate those modules to use Python-3 ready syntax. univention-management-console (12.0.31-3) 1c169b5aad65 | refactor(umc): migrate UMC-Server only parts to Python 3 syntax 5c4bd0295af3 | fix(umc): remove UMC-Server only modules from python 2 package
QA: timed out requests don't prevent session timeout (tested as described in Comment 1): OK advisories: OK occasionally this traceback appears in management-console-server.log: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/tornado/http1connection.py", line 735, in _server_request_loop ret = yield conn.read_response(request_delegate) File "/usr/lib/python3/dist-packages/tornado/gen.py", line 1133, in run value = future.result() File "/usr/lib/python3/dist-packages/tornado/gen.py", line 1147, in run yielded = self.gen.send(value) File "/usr/lib/python3/dist-packages/tornado/http1connection.py", line 245, in _read_message self.stream.set_close_callback(self._on_connection_close) File "/usr/lib/python3/dist-packages/tornado/iostream.py", line 606, in set_close_callback self._maybe_add_error_listener() File "/usr/lib/python3/dist-packages/tornado/iostream.py", line 1128, in _maybe_add_error_listener self._add_io_state(ioloop.IOLoop.READ) File "/usr/lib/python3/dist-packages/tornado/iostream.py", line 1158, in _add_io_state self.fileno(), self._handle_events, self._state) File "/usr/lib/python3/dist-packages/tornado/platform/asyncio.py", line 76, in add_handler raise ValueError("fd %s added twice" % fd) ValueError: fd 18 added twice The error is ignored in the main loop so it does not cause any problems.
<https://errata.software-univention.de/#/?erratum=5.0x721>