Bug 35408 - Filehandle for squidGuard.conf is not closed which disables UMC computerroom process
Filehandle for squidGuard.conf is not closed which disables UMC computerroom ...
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Proxy services
UCS@school 3.2 R2
Other Linux
: P5 normal (vote)
: UCS@school 3.2 R2 Errata
Assigned To: Sönke Schwardt-Krummrich
Florian Best
:
Depends on:
Blocks: 35151
  Show dependency treegraph
 
Reported: 2014-07-18 11:17 CEST by Sönke Schwardt-Krummrich
Modified: 2014-12-01 12:07 CET (History)
1 user (show)

See Also:
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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2014-07-18 11:17:27 CEST
<class 'httplib.HTTPException'> 500 on slave111 (computerroom/settings/set): {"status": 591, ...   [Errno 24] Zu viele offene Dateien\n"}

root@slave111:~# lsof | grep 9887  | grep /etc/squid/squidGuard.conf | wc -l
1004
root@slave111:~# ps axfwww | grep 9887
 9887 ?        Sl     4:54  \_ /usr/bin/python2.6 /usr/sbin/univention-management-console-module -m computerroom -s /var/run/univention-management-console/9514-1405636139278.socket -d 2 -n qt -l de_DE.UTF-8
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2014-08-01 12:10:51 CEST
This is annoying in the ucs-test scripts:
ucs-school-webproxy/conffiles/ucs-school-webproxy.py:101

	(_, fn_temp_config, ) = tempfile.mkstemp(dir=DIR_ETC)

mkstemp() returns an open file handle and the name of the temporary file. Python does not garbage collect the open file handle automatically, so the UMC module piles up open file handles.

Fix:
	(fno, fn_temp_config, ) = tempfile.mkstemp(dir=DIR_ETC)
	os.close(fno)
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2014-08-19 11:06:04 CEST
In UMC modules like the computerroom module that calls UCR directly for setting proxy UCR variables, for each call at least one open file handle leaked. Due to heavy use of the module by users or test scripts, the maximum number of open file handles is reached and the module behaves faulty.

Implemented the workaround of comment 1.

ucs-school-webproxy (10.0.4-1) unstable; urgency=low

Added changelog entry.
Comment 3 Florian Best univentionstaff 2014-08-20 09:16:31 CEST
Changelog: OK
Code-Review: OK
Fix: OK, reproduced with the ucs-school tests.
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2014-08-27 17:01:44 CEST
UCS@school 3.2 R2 v2 has been released:
http://docs.univention.de/release-notes-ucsschool-3.2R2v2-de.html

If this error occurs again, please use "Clone This Bug".