Bug 762382 (GLUSTER-650)

Summary: log message says "pthread_cond_timedout returned nonzero value" even when the return value is zero
Product: [Community] GlusterFS Reporter: Raghavendra Bhat <rabhat>
Component: loggingAssignee: Raghavendra Bhat <rabhat>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Anand Avati 2010-02-20 09:04:47 UTC
PATCH: http://patches.gluster.com/patch/2783 in master (fuse: check the return value of pthread_cond_timedwait before logging in fuse_thread_proc)

Comment 1 Raghavendra Bhat 2010-02-20 10:16:26 UTC
pthread_mutex_lock (&priv->child_up_mutex);
        {
                gettimeofday (&now, NULL);
                timeout.tv_sec = now.tv_sec + MAX_FUSE_PROC_DELAY;
                timeout.tv_nsec = now.tv_usec * 1000;

                while (priv->child_up_value) {

                        ret = pthread_cond_timedwait (&priv->child_up_cond,
                                                &priv->child_up_mutex,
                                                &timeout);
                        if (ret != 0)
                                break;

                }
        }
        pthread_mutex_unlock (&priv->child_up_mutex);

        gf_log (this->name, GF_LOG_DEBUG,
                " pthread_cond_timedout returned non zero value"
                " ret: %d errno: %d", ret, errno);


In the above code even the return value of pthread_cond_timeout is zero, the log message will be displayed as "pthread_cond_timedout returned non zero value" as it will be always executed after the unlock.