Simple paged results search slots are now correctly released after a failure
Previously, if a simple paged results search failed in the back end, the simple paged results slot was not released. Consequently, multiple simple paged results slots could be accumulated in a connection object. With this update, the simple paged results slot is released correctly when a search fails, and unused simple paged results slots are no longer left in a connection object.
Reproducer:
{{{
1. Install and configure the Directory Server WITHOUT a suffix "o=redhat".
2. Compile paged_def.c after adjusting the Directory Manager's password.
Note: the suffix o=redhat should not be adjusted.
https://fedorahosted.org/389/attachment/ticket/47707/paged_def.c
3. Run the compiled paged_def.
4. The access log would contain the result line with "err=32" AND a large pr_idx. E.g.,
> [..] conn=1 op=130870 RESULT err=32 tag=101 nentries=0 etime=0 notes=P pr_idx=43623
}}}
Build tested:
389-ds-base-1.3.5.6-1.el7.x86_64
Steps to reproduce:
1. Install and configure the Directory Server WITHOUT a suffix "o=redhat".
2. Compile paged_def.c after adjusting the Directory Manager's password and port number. - https://fedorahosted.org/389/attachment/ticket/47707/paged_def.c
[root@ds ~]# gcc paged_def.c -o paged_def -lldap
3. Run the compiled paged_def and wait for some time. Then stop the execution.
[root@ds ~]# ./paged_def
...
...
msgidp = 10000
Abandonned successfull
Before ldap search
Ldap search return is 0
msgidp = 10001
Abandonned successfull
...
...
^C
4. The access log shouldn't contain lines with "err=32" AND a large pr_idx.
[root@ds ~]# grep "err=32" /var/log/dirsrv/slapd-inst/access
[root@ds ~]# echo $?
1
Marking as verified.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHSA-2016-2594.html
Reproducer: {{{ 1. Install and configure the Directory Server WITHOUT a suffix "o=redhat". 2. Compile paged_def.c after adjusting the Directory Manager's password. Note: the suffix o=redhat should not be adjusted. https://fedorahosted.org/389/attachment/ticket/47707/paged_def.c 3. Run the compiled paged_def. 4. The access log would contain the result line with "err=32" AND a large pr_idx. E.g., > [..] conn=1 op=130870 RESULT err=32 tag=101 nentries=0 etime=0 notes=P pr_idx=43623 }}}