H Y created ZOOKEEPER-2878: ------------------------------ Summary: some issues in c code of lock of recipes Key: ZOOKEEPER-2878 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2878 Project: ZooKeeper Issue Type: Bug Components: recipes Reporter: H Y Priority: Minor
There are three issues in the c code of lock. 1, It not multi-thread safe, because pmutex is the local mutex of zkr_lock_mutex_t, if there are more than one thread is calling zkr_lock_lock, it may watch children node fail(retry_zoowexists may return NOT ZOK, 'unable to watch my predecessor' will output. I suggest that changing the pmutex to global. 2,child_floor function is not correct, it should compare the sequence of the node.(zoo_lock.c, line145 should be 'if (strcmp((sorted_data[i] + 19), (element + 19)) < 0)' 3, Logic mistaking in zkr_lock_operation of zoo_lock.c at line 256. mutex->id should be allocated by getName function. So, I think that we should delete from line 249 to 257. -- This message was sent by Atlassian JIRA (v6.4.14#64029)