Bug 28232 - Prozessablauf stoppen wenn Dateisystem fast voll ist
Prozessablauf stoppen wenn Dateisystem fast voll ist
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 3.0
Other Linux
: P5 enhancement (vote)
: UCS 4.1-2-errata
Assigned To: Philipp Hahn
Arvid Requate
:
Depends on:
Blocks: 28233 49200
  Show dependency treegraph
 
Reported: 2012-08-16 08:48 CEST by Janis Meybohm
Modified: 2019-03-29 15:37 CET (History)
2 users (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 Janis Meybohm univentionstaff 2012-08-16 08:48:20 CEST
Um einen defekten Listener Cache, eine leere notify_id o.ä. zu vermeiden sollte der Listener bei einem vollen Dateisystem (/var/lib/univention-directory-listener).

Ein entsprechender Ansatz wird bereits im Replikationsmodul durch die UCR Variable "ldap/replication/filesystem/limit" (default: 10MB) verfolgt (kann mitldap/replication/filesystem/check=yes aktiviert werden).

Ggf. reicht das schon aus (da ja dann auch der Cache nicht mehr aktualisiert wird? - Sollte ggf. geprüft werden), allerdings sollte das evtl. per default aktiviert werden da sonst immer recht aufwendige Reparaturen oder ein neuer Join notwendig sind.
Comment 1 Philipp Hahn univentionstaff 2013-02-25 14:29:45 CET
Der Code im Replikation-Listener ist IMHO falsch:
- Der Vergleich ist falsch herum: Der Listener stoppt, wenn mehr als 10 Byte frei sind!
- Eine Beschreibung der UCR-Variablen fehlt.
- Statt os.statvfs() wird jedes mal eine externe Shell + df geforked!
- Welche Einheit hat das Limit? Byte, KIB, MiB? Der default ist "10".

Grober Patchvorschlag:
--- univention-directory-replication/replication.py
+++ univention-directory-replication/replication.py
@@ -895,6 +859,6 @@
-		if listener.baseConfig.get('ldap/replication/filesystem/check', 'false').lower() in ['true', 'yes']:
-			df = os.popen('df -P /var/lib/univention-ldap/').readlines()
-			free_space = float(df[1].strip().split()[3])*1024*1024 # free space in MB
-			limit = float(listener.baseConfig.get('ldap/replication/filesystem/limit', '10'))
-			if limit < free_space:
+		if listener.baseConfig.is_true('ldap/replication/filesystem/check', False):
+			stat = os.statvfs(STATE_DIR)
+			free_space = stat.f_bavail * stat.f_bsize
+			limit = listener.baseConfig.get('ldap/replication/filesystem/limit', '10')
+			if float(free_space) < float(limit) * 1024.0 * 1024.0:

PS: Die Variable "df" wird in der nachfolgenden Fehlermeldung noch gebraucht. Entweder ist die zu Ändern oder nur in dem Fall sollte "df" extern aufgerufen werden.
Comment 2 Philipp Hahn univentionstaff 2016-06-06 11:51:01 CEST
r69830 | Bug #28232 repl: autopep8 -i --max-line-width=220
r69829 | Bug #28232 repl: assorted bash cleanup
r69828 | Bug #28232 repl: assorted Python cleanup
r69826 | Bug #28232 repl: univention.debug -> ud
r69825 | Bug #28232 repl: debian/ cleanup
r69824 | Bug #28232 repl: Fix filesystem full check
r69822 | Bug #28232 repl: Copyright 2016

Package: univention-directory-replication
Version: 9.0.1-3.104.201606061133
Branch: ucs_4.1-0
Scope: errata4.1-2

r69841 | Bug #33594,Bug #41347,Bug #28232,Bug #30489,Bug #31757: univention-directory-logger YAML
 univention-directory-replication.yaml
Comment 3 Stefan Gohmann univentionstaff 2016-07-13 16:28:31 CEST
(In reply to Philipp Hahn from comment #2)
> r69830 | Bug #28232 repl: autopep8 -i --max-line-width=220

You've changed the indentation from tabs to spaces. Please revert this because we use tabs. For example backports would be difficult.
Comment 4 Philipp Hahn univentionstaff 2016-07-18 15:20:22 CEST
(In reply to Stefan Gohmann from comment #3)
> (In reply to Philipp Hahn from comment #2)
> > r69830 | Bug #28232 repl: autopep8 -i --max-line-width=220
> 
> You've changed the indentation from tabs to spaces. Please revert this
> because we use tabs. For example backports would be difficult.

r71062 | Bug #28232 repl: Make tab-lovers happy again
Comment 5 Arvid Requate univentionstaff 2016-07-18 17:49:42 CEST
Code review: Ok
Functional test: Ok
Advisory: Ok
Comment 6 Janek Walkenhorst univentionstaff 2016-07-21 15:15:56 CEST
<http://errata.software-univention.de/ucs/4.1/216.html>