Bug 37631 - univention-ldapsearch stops retries before reaching the 'ldap/client/retry/count'
univention-ldapsearch stops retries before reaching the 'ldap/client/retry/co...
Product: UCS
Classification: Unclassified
Component: univention-base-files
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-1-errata
Assigned To: Philipp Hahn
Erik Damrose
Depends on:
Blocks: 37299
  Show dependency treegraph
Reported: 2015-01-27 12:54 CET by Dmitry Galkin
Modified: 2015-03-11 17:28 CET (History)
3 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:

Proposed patch univention-ldapsearch (513 bytes, patch)
2015-01-30 10:09 CET, Dmitry Galkin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Galkin univentionstaff 2015-01-27 12:54:38 CET
For all details see Bug #37299

The 10_ldap/26reconnect_univention_ldapsearch test sometimes fails in Amazon EC2 (http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-0/job/Autotest%20MultiEnv/125/SambaVersion=s3,Systemrolle=master/testReport/junit/10_ldap/26reconnect_univention_ldapsearch/test/).

Reason is that 'univention-ldapsearch' often stops the retries after only 1 attempt, i.e. not reaching the 'ldap/client/retry/count' (UCR).
Comment 1 Dmitry Galkin univentionstaff 2015-01-30 10:09:07 CET
Created attachment 6638 [details]
Proposed patch univention-ldapsearch

Simply sleep before grepp'ing, not after.
Comment 2 Philipp Hahn univentionstaff 2015-02-26 15:00:41 CET
(In reply to Dmitry Galkin from comment #1)
> Simply sleep before grepp'ing, not after.

>  	do_search
> +	sleep 1
>  	ret=$?

That's wrong, as $ret now contains the exit status of the most-successfully run "sleep" instead of the "ldap-search".

But moving the "sleep" shows the underlying problem: If the "tee" is too slow, the expected error message is not yet written into the file, so the following "grep" does not see the error message and aborts the loop.

FYI: Re-try mechanism was implemented with original Bug 34293: r48490 r48521

r58481 | Bug #37631 UCR: Update copyright 2015
r58480 | Bug #37631 UCR: Fix univention-ldapsearch race condition
 Run one "tee" per loop and wait for its termination.

Package: univention-config-registry
Version: 10.0.1-8.480.201502261454
Branch: ucs_4.0-0
Scope: errata4.0-1

r58482 | Bug #37631 UCR: Fix univention-ldapsearch race condition YAML
Comment 3 Erik Damrose univentionstaff 2015-03-05 13:24:54 CET
OK: reproduceable with modified tee (see r58480 message)
OK: not reproduceable with fixed version
OK: No sideeffects could be found in own testing and in jenkins tests
Comment 4 Janek Walkenhorst univentionstaff 2015-03-11 17:28:38 CET