URL:
https://github.com/SSSD/sssd/pull/46
Title: #46: sss_client: Defer thread cancellation until completion of nss/pam operations
sumit-bose commented:
"""
The patch looks good and works as expected and removes the dependency to libpthread.
If I understand the it correctly there is a small functional difference between the old
version with a robust mutex and the new pthread_setcancelstate() way. The mutex protects
the communication between the client and SSSD's responders so that so that a single
thread can send a request and wait for the response before another thread can send a
different request. Since some requests, like e.g. getrgnam() for a group with many members
and maybe even nested groups on the server-side, might need some time to make all data
available there is quite a long timeout of 300s. So in the worst case a single thread can
keep the mutex for 5 minutes.
With a robust mutex it might be possible for a master-thread to cancel the thread blocking
the access to SSSD earlier so that other threads can continue and send requests to SSSD.
If cancellation is disabled for the thread the application might be block for 5 minutes
before anything can proceed. I'm not sure how many applications would be really
affected by this. Additionally @fweimer 's comments in
https://bugzilla.redhat.com/show_bug.cgi?id=1369130#c4 are still valid (although I guess
in nearly all cases the cancellation would happen when the client is waiting for a
response from SSSD).
I wonder if it would makes sense to add a configure option to select which code is used
and make the pthread_setcancelstate() way the default. This makes it easy to switch to the
robust mutexes and if there are no issue for some time the old code and the configure
option can be removed.
On the other hand the magic of git makes it possible as well to recover the old code with
reasonable effort and would avoid a new configure option and a code-path which is
typically not tested in the default installation. @lslebodn, @jhrozek, any preference?
"""
See the full comment at
https://github.com/SSSD/sssd/pull/46#issuecomment-256887672