https://bugs.openldap.org/show_bug.cgi?id=9776
Issue ID: 9776 Summary: Deleting syncrepl config does not close the connection to the provider Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: tero.saarni@est.tech Target Milestone: ---
I have set up replication between two slapd instances and it works OK.
When I remove olcSyncRepl from the consumer, it seems that the connection to provider is never closed. I have observed this with lsof -p $(pidof slapd).
When using Monitor it can be also observed (from cn=Tasklist,cn=Threads,cn=Monitor) that the do_syncrepl task is not removed when deleting olcSyncRepl.
If repeatedly deleting and adding olcSyncRepl it can be observed that the number of connections and tasks increases continuously. At some point, around adding/deleting 1000 times, the modify operation will fail:
ldap_modify: Other (e.g., implementation specific) error (80)
slapd logs have error
61d574b9.1ff5d9a7 0x7fcfddfdc700 ldif_read_file: Too many open files for "/home/tsaarni/work/openldap/tests/testrun/slapd.1.d/cn=config/olcDatabase={1}mdb.ldif" 61d574b9.1ff64149 0x7fcfddfdc700 send_ldap_result: conn=3034 op=1 p=3 61d574b9.1ff679b8 0x7fcfddfdc700 send_ldap_result: err=80 matched="" text="internal error (cannot read some entry file)" 61d574b9.1ff70008 0x7fcfddfdc700 send_ldap_result: conn=3034 op=1 p=3
Number of established connections to provider 1011
$ lsof -p 4101355 | grep "localhost:9012 (ESTABLISHED)" | wc -l 1011
Number of do_syncrepl tasks is also 1011
$ ldapsearch -LLL -x -D cn=config -wsecret -b cn=Tasklist,cn=Threads,cn=Monitor -H ldap://localhost:9011/ monitoredInfo ... monitoredInfo: {1008}do_syncrepl(rid=002) monitoredInfo: {1009}do_syncrepl(rid=002) monitoredInfo: {1010}do_syncrepl(rid=002)
Maximum number of file handles for the process was 1024.
I'm using openldap master branch.
I have a test case for reproducing the problem, which I will add to this issue.