Bug 40627

Summary: UMC-Server: crashed during session timeout
Product: UCS Reporter: Florian Best <best>
Component: UMC (Generic)Assignee: Florian Best <best>
Status: CLOSED FIXED QA Contact: Sönke Schwardt-Krummrich <schwardt>
Severity: normal    
Priority: P5 CC: walkenhorst
Version: UCS 4.1Flags: best: Patch_Available+
Target Milestone: UCS 4.1-1-errata   
Hardware: Other   
OS: Linux   
What kind of report is it?: --- What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional): Error handling
Max CVSS v3 score:
Attachments: patch

Description Florian Best univentionstaff 2016-02-10 12:44:34 CET
The UMC-Server crashed during a module session timeout (race condition).
This happened in a ucs-school-test.

09.02.16 22:33:47.302  MODULE      ( INFO    ) : Executing ['computerroom/room/acquire']
09.02.16 22:33:47.302  RESOURCES   ( INFO    ) : Searching for module providing command computerroom/room/acquire
09.02.16 22:33:47.302  RESOURCES   ( INFO    ) : Found module computerroom
09.02.16 22:33:47.302  MAIN        ( INFO    ) : Starting new module process and passing new request to module computerroom: 145507521866475-86
09.02.16 22:33:47.302  MAIN        ( PROCESS ) : running: ['/usr/sbin/univention-management-console-module', '-m', 'computerroom', '-s', '/var/run/univention-management-console/3798-1455075227302.socket', '-d', '4', '-n', 'qt', '-l', 'de_DE.UTF-8']
09.02.16 22:33:47.352  MAIN        ( PROCESS ) : module schoolgroups is still running - purging module out of memory
09.02.16 22:33:47.397  MAIN        ( ERROR   ) : Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-server", line 226, in <module>
    umc_daemon.do_action()
  File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 186, in do_action
    func(self)
  File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 131, in _start
    self.app.run()
  File "/usr/sbin/univention-management-console-server", line 203, in run
    notifier.loop()
  File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 286, in loop
    step()
  File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 242, in step
    if not timer[ CALLBACK ]():
  File "/usr/lib/pymodules/python2.7/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 313, in _purge_child
    os.kill(pid, 9)
OSError: [Errno 3] Kein passender Prozess gefunden
Comment 1 Florian Best univentionstaff 2016-02-10 12:47:37 CET
Created attachment 7463 [details]
patch
Comment 2 Florian Best univentionstaff 2016-02-18 12:51:09 CET
univention-management-console.yaml:
r67540 | YAML Bug #40627 Bug #40658

univention-management-console (8.0.28-12):
r67537 | Bug #40627: fix UMC-Server crash during session timeout
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2016-02-23 13:45:54 CET
Was unable to reproduce the exact code path, so I did a dry-run check in interactive python shell:

>>> import os
>>> pid = 32300
>>> module_name = 'MyMod'
>>> try:
...     os.kill(pid, 9)
... except OSError as exc:
...     print 'Failed to kill module %s: %s' % (module_name, exc)
... 
Failed to kill module MyMod: [Errno 3] No such process
>>> 

OK: code change
(OK): functional test
REOPEN: YAML (should be delivered only for UCS 4.1-1) → version: [1]
Comment 4 Florian Best univentionstaff 2016-02-23 14:02:42 CET
(In reply to Sönke Schwardt-Krummrich from comment #3)
> REOPEN: YAML (should be delivered only for UCS 4.1-1) → version: [1]
Done.
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2016-02-24 10:28:19 CET
OK: YAML
Comment 6 Janek Walkenhorst univentionstaff 2016-02-24 13:06:11 CET
<http://errata.software-univention.de/ucs/4.1/121.html>