You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] PD PartitionCache lockGraph method opposite to the expected behavior. #2639
To fix the logic design issue in the lockGraph method of the PartitionCache class, you need to change the condition in the while loop. The compareAndSet method returns true if it successfully sets the value, meaning the lock was acquired, so the loop should exit. The correct condition should be !lock.compareAndSet(false, true).
Activity
dosubot commentedon Aug 14, 2024
To fix the logic design issue in the
lockGraphmethod of thePartitionCacheclass, you need to change the condition in thewhileloop. ThecompareAndSetmethod returnstrueif it successfully sets the value, meaning the lock was acquired, so the loop should exit. The correct condition should be!lock.compareAndSet(false, true).Here is the corrected
lockGraphmethod:This change ensures that the loop will continue spinning only if the
compareAndSetmethod fails to acquire the lock [1].To continue talking to Dosu, mention @dosu.
close apache#2639