-
Notifications
You must be signed in to change notification settings - Fork 103
Issue 6080 - ns-slapd crash in referint_get_config #6081
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
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.
Sorry, but the fix looks wrong:
[1] Not sure you really want to lose the pending changes at shutdown
[2] It does not ensure that the thread is really stopped when destroying the config.
IMHO After resetting the keeprunning flag in referint_postop_close once the keeprunning_mutex is released you have to wait for the thread completion before going on with the clean up
|
Thanks for the review. You are correct the first patch was wrong. I changed the mechanism to sync plugin stop fct with the batch thread. |
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.
LGTM even I would have preferred the use of a wait_cond but atomic operation and sleep should also do the job !
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: 389ds#6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description: Referential integrity plugin spawn a thread to run integrity check/update in a deferred way. It uses a log file to pipe changes to check. The name of the file, stored in the config, is read periodically. At shutdown, referint plugin close callback notifies the thread to stop and free the config. The problem is that the thread may check the config while it was notify to stop. Fix description: synchronize the plugin close function (referint_postop_close) and the batch thread (referint_thread_func). When the batch thread starts it set 'batch_thread_running' and reset it when it stops. The plugin close function notifes the batch thread to stop (via keeprunning==0) and then wait 'batch_thread_running' is reset relates: #6080 Reviewed by: Pierre Rogier (thanks !)
Bug description:
Referential integrity plugin spawn a thread to run
integrity check/update in a deferred way. It uses a log
file to pipe changes to check. The name of the file,
stored in the config, is read periodically.
At shutdown, referint plugin close callback notifies
the thread to stop and free the config.
The problem is that the thread may check the config
while it was notify to stop.
Fix description:
Check the notification (keeprunning) before reading
the config
relates: #6080
Reviewed by: