Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle termination of syncrepl watcher thread #6

Closed
wants to merge 1 commit into from

Conversation

tkrizek
Copy link
Contributor

@tkrizek tkrizek commented Dec 19, 2016

In some cases, the thread could have been already terminated and
sending a signal to the thread using pthread_kill() would result in an
error. Now if the thread has already been terminated for some reason,
only an error message is logged.

https://fedorahosted.org/bind-dyndb-ldap/ticket/149

Copy link
Contributor

@pspacek pspacek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are almost there. Just minor changes will make it perfect :-)

@@ -747,6 +739,25 @@ destroy_ldap_instance(ldap_instance_t **ldap_instp)
*ldap_instp = NULL;
}

void watcher_shutdown(ldap_instance_t *ldap_inst)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be named ldap_syncrepl_watcher_shutdown so it is clear from its name where it belongs...

* used by BIND itself.
*/
REQUIRE(pthread_kill(ldap_inst->watcher, SIGUSR1) == 0);
watcher_shutdown(ldap_inst);
RUNTIME_CHECK(isc_thread_join(ldap_inst->watcher, NULL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move isc_thread_join into the shutdown function as well.

@@ -747,6 +739,25 @@ destroy_ldap_instance(ldap_instance_t **ldap_instp)
*ldap_instp = NULL;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is missing a comment. Please add one and describe what it does and under what conditions. Please see other Doxygen-style comments for inspiration.

@pspacek
Copy link
Contributor

pspacek commented Dec 20, 2016

We are almost there. Just minor changes will make it perfect :-)

@tbordaz
Copy link

tbordaz commented Dec 20, 2016

The patch looks good to me. ACK

@pspacek pspacek added the ack label Dec 20, 2016
In some cases, the thread could have been already terminated and
sending a signal to the thread using pthread_kill() would result in an
error. Now if the thread has already been terminated for some reason,
only an error message is logged.

https://fedorahosted.org/bind-dyndb-ldap/ticket/149

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Thierry Bordaz <tbordaz@redhat.com>
@tkrizek
Copy link
Contributor Author

tkrizek commented Dec 20, 2016

Fixed upstream: edd8c0552eb7e977a961c9492eb18c177685e438

@tkrizek tkrizek closed this Dec 20, 2016
@tkrizek tkrizek added the pushed label Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants