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
Conversation
There was a problem hiding this 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) | |||
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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; | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
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.
|
We are almost there. Just minor changes will make it perfect :-) |
|
The patch looks good to me. ACK |
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>
|
Fixed upstream: edd8c0552eb7e977a961c9492eb18c177685e438 |
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