Bug 1370921 - Improve robustness by checking result of pthread_mutex_lock()
Summary: Improve robustness by checking result of pthread_mutex_lock()
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL: http://www.gluster.org/pipermail/main...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-28 11:00 UTC by Niels de Vos
Modified: 2019-11-19 12:44 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-11-19 12:44:21 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Niels de Vos 2016-08-28 11:00:04 UTC
Description of problem:
pthread_mutex_lock() can return without successfully locking the mutex. Many calls to this function assume that is always blocks until the locking succeeds.

Version-Release number of selected component (if applicable):
all

How reproducible:
code review

Actual results:
Many data structures use a pthread_mutex for exclusive access and guaranteeing atomic updates. Unfortunately a lot of occurrences do not check the success/fail result of the call to pthread_mutex_lock().

Expected results:
In case pthread_mutex_lock() fails, a retry or abort of the function should be done, depending on the result errno contains.

Additional info:
See 'man 3p pthreead_mutex_lock'.

Comment 1 Mohit Agrawal 2019-11-19 12:44:21 UTC
I don't think we will get some improvement after check the return code of pthread_mutex_(lock|unlock) call
so  I am closing this enhancement. Please feel free to reopen the bug if you think it is useful to improve the performance.

Thanks,
Mohit Agrawal


Note You need to log in before you can comment on or make changes to this bug.