Univention Bugzilla – Bug 30611
PackageManager may break by UMC Timeout
Last modified: 2013-05-22 16:09:50 CEST
I installed agorum, which takes some time (read: ages) to install: "Optimizing: http://localhost:81/roiwebui/**.jsp" I accidentally closed the browser tab (and did not reconnect). After ten minutes UMC killed the not used (in terms of frontend requests) appcenter module. Agorum was not completely installed at that time. root@slave92:~# dpkg -l *agorum* un agorumcore-open iF agorumcore-pro iU agorumcore-ucs iU univention-management-console-module-agorum More serious, this behaviour seems to not free dpkg lock: root@slave92:~# apt-get install E: Konnte Sperre /var/lib/dpkg/lock nicht bekommen - open (11: Die Ressource ist zur Zeit nicht verfügbar) E: Sperren des Administrationsverzeichnisses (/var/lib/dpkg/) nicht möglich, wird es von einem anderen Prozess verwendet? I did not test it but this may also happen with the long-running UCC download while normally 10 minutes should be sufficient to complete an installation. Nonetheless, this is critical.
After some time this is possible: root@slave92:~# dpkg -l *agorum* un agorumcore-open iF agorumcore-pro iU agorumcore-ucs iU univention-management-console-module-agorum root@slave92:~# apt-get install E: Der dpkg-Prozess wurde unterbrochen; Sie müssen manuell »dpkg --configure -a« ausführen, um das Problem zu beheben. root@slave92:~# dpkg --configure -a agorumcore-pro (7.0.3-6) wird eingerichtet ... [...] root@slave92:~# dpkg -l *agorum* un agorumcore-open ii agorumcore-pro ii agorumcore-ucs ii univention-management-console-module-agorum Phew. But quite some bug anyway.
Maybe a solution as suggested in Bug 30155 would make sense here?
(In reply to comment #2) > Maybe a solution as suggested in Bug 30155 would make sense here? Would not fix the underlying problem: If you really log out because you get bored staring at a progress bar the module will get killed by UMC itself. I would suggest: Either we add a "please_dont_kill_me" flag for each module and the app center sets it while it is installing. Or the PackageManager becomes just an interface for a inter-process communication and a "PackageManagerDaemon" runs all the time accepting queues like installation. This would also fix Bug#30155 if you meant it this way.
(In reply to comment #3) > (In reply to comment #2) > > Maybe a solution as suggested in Bug 30155 would make sense here? > > Would not fix the underlying problem: If you really log out because you get > bored staring at a progress bar the module will get killed by UMC itself. > > I would suggest: Either we add a "please_dont_kill_me" flag for each module and > the app center sets it while it is installing. Or the PackageManager becomes > just an interface for a inter-process communication and a > "PackageManagerDaemon" runs all the time accepting queues like installation. > This would also fix Bug#30155 if you meant it this way. Well, I meant using an AT job (similar to the updater) to start the installation in the background. dont_kill_me flag does not seem to be a reasonable option, it is necessary that the UMC server can eventually kill zombie module processes.
*** Bug 30155 has been marked as a duplicate of this bug. ***
From Bug 30155: > Upon opening the module, the module should check for an ongoing installation, > and a progressbar should be prompted in that case. This should be addressed via this bug, as well.
Simple workaround: The module process will not be killed (even not after a timeout) if at least one request is still open (c.f. Bug 21888). Therefore, one could leave the initial request open which triggers the installation. If the request is then answered after the installation, this should be fine, then. That means then, as well, that the initial request will probably run in a timeout on the client side.
(In reply to comment #7) > Simple workaround: The module process will not be killed (even not after a > timeout) if at least one request is still open (c.f. Bug 21888). Therefore, one > could leave the initial request open which triggers the installation. If the > request is then answered after the installation, this should be fine, then. > That means then, as well, that the initial request will probably run in a > timeout on the client side. Good point. Although it will probably be more hacky. The initial request is important and has to return something meaningful ("can_continue", "broken", etc). We would need to send another request to, say, appcenter/keep_alive, which does something like that: def keep_alive(self, request): # and all this in a thread because otherwise the module will be blocked while not self.package_manager.progress_state._finished: time.sleep(1) self.finished(request.id, True) But maybe this can be simplified (initial request does not have to return if can_continue is True) together with Bug#30798
(In reply to comment #8) > def keep_alive(self, request): > # and all this in a thread because otherwise the module will be blocked > while not self.package_manager.progress_state._finished: > time.sleep(1) > self.finished(request.id, True) Done exactly that in (3.1-2): univention-management-console-module-appcenter 2.0.142-1.119.201304081444
Built for 3.1-1: univention-management-console-module-appcenter 2.0.139-2.120.201304102007 Changelog updated, YAML created
(In reply to comment #6) > From Bug 30155: > > Upon opening the module, the module should check for an ongoing installation, > > and a progressbar should be prompted in that case. > > This should be addressed via this bug, as well. This needs to be done, if i start the agorum app installation and then close the browser, open the browser and logon to the UMC, i can open the appcenter module and start the installation of another app (or agorum again), then weird things happen and i end up with -> apt-get -f install E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
(In reply to comment #11) > This needs to be done, Yes, but it is out of scope of this bug. These are two separate problems and I did not find a good sentence for the changelog that covers both issues. Moreover it is easier for QA to verify the bug fix.
OK - set umc/module/timeout=10, started agorum app installation and closed the browser, app was successfully installed OK - errata3.1-1 OK - YAML OK - ucs3.1-2 OK - changelog
http://errata.univention.de/ucs/3.1/102.html