Univention Bugzilla – Bug 31752
UMC server does not reload UCR variables due to error in pyinotify.WatchManager
Last modified: 2013-11-19 06:43:31 CET
Created attachment 5277 [details] Simple test script pyinotify raises an OSError if one of the inotify limits is hit (max_user_instances in this case - I guess). As the limits are user wide, this may lead to crashing umc modules or server. Implementation in: univention-management-console/src/univention/management/console/protocol/server.py
Created attachment 5279 [details] inotify.patch, cleanup Some cleanup from my working copy. Patch does not let UMC-Server crash.
I may be wrong but I think there was another bug with "delayed" results when requesting UCR variables that changed (very) recently. I think we should remove the complete pyinotify part and just ucr.load() before each UCR variable request. ucr.load() is relatively fast and requesting UCR variables happens not very often (maybe once a minute when opening a UDM module?). I did not look into the code but this is what the inotify thing does, no? Keeping UCR variables up to date? The inotify overhead and the ucr.load() overhead may be equal and the latter is less error prone.
(In reply to Dirk Wiesenthal from comment #2) > I may be wrong but I think there was another bug with "delayed" results when > requesting UCR variables that changed (very) recently. > > I think we should remove the complete pyinotify part and just ucr.load() > before each UCR variable request. ucr.load() is relatively fast and > requesting UCR variables happens not very often (maybe once a minute when > opening a UDM module?). > > I did not look into the code but this is what the inotify thing does, no? > Keeping UCR variables up to date? The inotify overhead and the ucr.load() > overhead may be equal and the latter is less error prone. We had this before (reloading every X seconds instead of only reloading if changes occured) and ran into trouble...
(In reply to Florian Best from comment #3) > We had this before (reloading every X seconds instead of only reloading if > changes occured) and ran into trouble... I can imagine that. That is why I suggest reloading it at every umcp/ucr request, regardless if someone changed UCR variables before.
(In reply to Dirk Wiesenthal from comment #4) > (In reply to Florian Best from comment #3) > > We had this before (reloading every X seconds instead of only reloading if > > changes occured) and ran into trouble... > > I can imagine that. That is why I suggest reloading it at every umcp/ucr > request, regardless if someone changed UCR variables before. univention.management.console.config provides a global UCR instance (the instance which is realoaded automatically). This is used and relies on it in various (at least 3) places of the UMC-Server.
The autoload of UCR variables is currently not working, so i suggest to remove the code completely.
(In reply to Dirk Wiesenthal from comment #4) > I can imagine that. That is why I suggest reloading it at every umcp/ucr > request, regardless if someone changed UCR variables before. +1 ... there are usually not many UCR request For what else than umcp/ucr is the reload relevant? (In reply to Florian Best from comment #6) > The autoload of UCR variables is currently not working, so i suggest to > remove the code completely. +1
*** Bug 29781 has been marked as a duplicate of this bug. ***
This bug currently blocks the dialog with information about anonymous user statistics (Bug 30811). Currently, I can switch anonymous user statistics off and after the next login, it is still enabled. It should be fine to reload the internal UCR cache after each login and at each UCR request.
The inotify mechanism has been removed. On login and when doing GET/ucr and GET/info UMCP-Commands the UCR variables are reloaded. univention-management-console (6.0.4-1)
QA: I removed the line > src/univention/management/console/protocol/server.py:import pyinotify as there is no reference to pyinotify anymore. Changes are fine. Changelog entry has been added.
I guess the pre-dependency to pyinotify in debian/control can also be removed: ==================== Package: python-univention-management-console ... Pre-Depends: python-pyinotify ====================
(In reply to Alexander Kläser from comment #12) > I guess the pre-dependency to pyinotify in debian/control can also be > removed: > ==================== > Package: python-univention-management-console > ... > Pre-Depends: > python-pyinotify > ==================== Yes, it has been removed. univention-management-console (6.0.8-2)
(In reply to Florian Best from comment #13) > Yes, it has been removed. univention-management-console (6.0.8-2) Looks good now → VERIFIED
*** Bug 32825 has been marked as a duplicate of this bug. ***
UCS 3.2 has been released: http://docs.univention.de/release-notes-3.2-en.html http://docs.univention.de/release-notes-3.2-de.html If this error occurs again, please use "Clone This Bug".