Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
584858eb
Commit
584858eb
authored
Sep 22, 2020
by
Howard Chu
Committed by
Quanah Gibson-Mount
Sep 22, 2020
Browse files
ITS
#8102
syncrepl: only use trylock on the cn=config DB
parent
7e29c7f7
Pipeline
#1073
passed with stage
in 60 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/syncrepl.c
View file @
584858eb
...
...
@@ -124,6 +124,7 @@ typedef struct syncinfo_s {
int
si_got
;
int
si_strict_refresh
;
/* stop listening during fallback refresh */
int
si_too_old
;
int
si_is_configdb
;
ber_int_t
si_msgid
;
Avlnode
*
si_presentlist
;
LDAP
*
si_ld
;
...
...
@@ -974,12 +975,18 @@ get_pmutex(
syncinfo_t
*
si
)
{
while
(
ldap_pvt_thread_mutex_trylock
(
&
si
->
si_cookieState
->
cs_pmutex
))
{
if
(
slapd_shutdown
)
return
SYNC_SHUTDOWN
;
if
(
!
ldap_pvt_thread_pool_pausecheck
(
&
connection_pool
))
ldap_pvt_thread_yield
();
if
(
!
si
->
si_is_configdb
)
{
ldap_pvt_thread_mutex_lock
(
&
si
->
si_cookieState
->
cs_pmutex
);
}
else
{
/* avoid deadlock when replicating cn=config */
while
(
ldap_pvt_thread_mutex_trylock
(
&
si
->
si_cookieState
->
cs_pmutex
))
{
if
(
slapd_shutdown
)
return
SYNC_SHUTDOWN
;
if
(
!
ldap_pvt_thread_pool_pausecheck
(
&
connection_pool
))
ldap_pvt_thread_yield
();
}
}
return
0
;
}
...
...
@@ -5641,6 +5648,8 @@ add_syncrepl(
LDAP_LIST_INIT
(
&
si
->
si_nonpresentlist
);
ldap_pvt_thread_mutex_init
(
&
si
->
si_mutex
);
si
->
si_is_configdb
=
strcmp
(
c
->
be
->
be_suffix
[
0
].
bv_val
,
"cn=config"
)
==
0
;
rc
=
parse_syncrepl_line
(
c
,
si
);
if
(
rc
==
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment