Univention Bugzilla – Bug 52273
UMC-Web-Server: don't count down session timeout second wise
Last modified: 2021-01-14 17:05:41 CET
The UMC-Web-Server counts down session timeouts second wise. This is because of Bug #24943 (git:5cdc3849dd5), where the system time is changed via rdate during the join which then invalids all sessions if the time is not synchron with the DC Master. We should evaluate if we can solve this in a different way, e.g. detecting a system change in the daemon, (restarting services during join? - probably not), etc. The same might apply to the UMC-Server and module processes. +++ This bug was initially created as a clone of Bug #52272 +++
Python >= 3.3 provides time.monotonic(): https://docs.python.org/3/library/time.html#time.monotonic
see also git:79ad2a2e1c375f5d3b1e80324cbe3abfffbf8895 (Bug #42174)
(In reply to Florian Best from comment #1) > Python >= 3.3 provides time.monotonic(): > https://docs.python.org/3/library/time.html#time.monotonic There is a Python 2.7 backport in python-monotonic. We will fix python-notifier to use this. Then we can use the logic from before Bug #24943.
A test script which also verifies that sessions are correctly closed and timers removed when the session times out but there are still open requests is: import time import threading from univention.lib.umc import Client c = Client() c.authenticate('Administrator', 'univention') def ping(): print('Started thread') print(c.umc_command('setup/ping', options={'keep_alive': True}).result) t = threading.Thread(target=ping) t.start() try: while True: print(c.umc_get('session-info').result) time.sleep(5) except KeyboardInterrupt: pass #t.join() # python -i test_st.py # ucr set umc/http/session/timeout='15'; systemctl restart univention-management-console-web-server # sleep 15 # pkill -f console-module
The monotonic time approach has been implemented in python-notifier. Package: python-notifier Version: 0.9.7-8A~4.4.0.202012011529 Branch: ucs_4.4-0 Scope: errata4.4-7 The timers have been restored to behavior similar before git:5cdc3849dd5e70055a2c35fdd950532aaac8cb43. Unfortionately I used Bug #52272 in one commit message. univention-management-console.yaml 548722752eab | YAML Bug #52371, Bug #52443, Bug #52442, Bug #52444, Bug #52293, Bug #52272 univention-management-console (11.0.5-24) 37ac7a357a63 | Bug #52273: don't count down session timeout second wise univention-management-console (11.0.5-24) 021e0ee2a6d4 | Bug #52272: cleanup all sessions with one timer
python-monotonic is not installable under 4.4-7, which leads to univention-ldap-server not being installable, which lead to all our jenkins tests failing, due to /etc/machine.secret missing. http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-7/job/AutotestJoin/
python-monotonic is unmaintained and needs to be moved to maintained to solve this issue.
added python-monotonic to maintained 780395c760c5be1f363873dfeb324246c08f6ced - yaml svn r83155 added to trigger list ucs_4.4-0-ucs4.4-7.txt cd /var/univention/buildsystem2/apt/ucs_4.4-0-errata4.4-7 /home/fbotner/git/toolshed/REPO/repo-copy-dsc -v ../ucs_4.3-0/source/python-monotonic_1.1-2.dsc repo-apt-ftparchive . waited for jenkins CalculateMaintained started Publish UCS 4.4 errata test scopes to testing
> added python-monotonic to maintained > > 780395c760c5be1f363873dfeb324246c08f6ced - yaml > > svn r83155 added to trigger list ucs_4.4-0-ucs4.4-7.txt > > cd /var/univention/buildsystem2/apt/ucs_4.4-0-errata4.4-7 > /home/fbotner/git/toolshed/REPO/repo-copy-dsc -v > ../ucs_4.3-0/source/python-monotonic_1.1-2.dsc > repo-apt-ftparchive . > waited for jenkins CalculateMaintained > started Publish UCS 4.4 errata test scopes to testing OK
What I tested: Upgrade -> OK Login -> OK Login SAML -> OK users/user -> OK jenkins -> OK session timeout -> OK python-monotonic -> "Get:7 http://updates-test.software-univention.de/4.4/maintained/component 4.4-7-errata-test/all/ python-monotonic 1.1-2 [5,210 B]" -> OK YAML -> OK
Merge 5.0 -> OK
<https://errata.software-univention.de/#/?erratum=4.4x846> <https://errata.software-univention.de/#/?erratum=4.4x848> <https://errata.software-univention.de/#/?erratum=4.4x849>