Whamcloud - gitweb
LU-13358 libcfs: add timeout to cfs_race() to fix race
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 30 Mar 2021 05:57:14 +0000 (08:57 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 23 Sep 2022 16:41:12 +0000 (16:41 +0000)
commit1589ab8a1eef63e0ac50014d456daa1397d793b2
treecd25357cc354e757e7e4f5a8bf9a239b71915315
parent8a8f7e063e0f733531de4875a73d59082f2bec6d
LU-13358 libcfs: add timeout to cfs_race() to fix race

there is no guarantee for the branches in cfs_race() to be executed
in strict order, thus it's possible that the second branch (with
cfs_race_state=1) is executed before the first branch and then another
thread executing the first branch gets stuck.

this construction is used for testing only and as a
workaround it's enough to timeout.

Lustre-change: https://review.whamcloud.com/43161
Lustre-commit: 2d2d381f35ee004319a20f5d2d8e70d13480d6c7

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ie1cc0accedb3e1a198d4b17d1ab00ce298c560f2
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/48553
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
libcfs/include/libcfs/libcfs_fail.h