Coder Social home page Coder Social logo

Comments (2)

erthink avatar erthink commented on August 16, 2024

Seems that syncrepl_config() has a race.
@hyc?

diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c
index eaedc61..fc615e9 100644
--- a/servers/slapd/syncrepl.c
+++ b/servers/slapd/syncrepl.c
@@ -5815,6 +5815,7 @@ syncrepl_config( ConfigArgs *c )
                                         * happen when running on the cn=config DB.
                                         */
                                        if ( si->si_re ) {
+                                               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
                                                if ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
                                                        isrunning = 1;
                                                } else {
@@ -5832,7 +5833,6 @@ syncrepl_config( ConfigArgs *c )
                                                                si->si_conn = NULL;
                                                        }

-                                                       ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
                                                        if ( ldap_pvt_runqueue_isrunning( &slapd_rq, re ) ) {
                                                                ldap_pvt_runqueue_stoptask( &slapd_rq, re );
                                                                isrunning = 1;
@@ -5842,10 +5842,10 @@ syncrepl_config( ConfigArgs *c )
                                                                isrunning = 0;

                                                        ldap_pvt_runqueue_remove( &slapd_rq, re );
-                                                       ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );

                                                        ldap_pvt_thread_mutex_unlock( &si->si_mutex );
                                                }
+                                               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
                                        }
                                        if ( !isrunning ) {
                                                syncinfo_free( si, 0 );

from reopenldap.

hyc avatar hyc commented on August 16, 2024

I've seen this once on Windows. But I don't see why holding the runq mutex fixes it, since the do_syncrepl thread runs out of the connection dispatcher, not the runqueue. ??

Ah, a scheduled refresh. never mind the question.

Eh, no. Your stack trace shows a do_syncrepl from the connection dispatcher, not from the runqueue. So back to my first question.

from reopenldap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.