From 4a33e1edd48c5db0e0c54c1226787c6575301bee Mon Sep 17 00:00:00 2001 From: Jadhav Vikram Date: Wed, 15 Feb 2017 09:52:12 +0530 Subject: [PATCH] LU-9511 utils: fix parallel_grouplock test timeout In parallel_grouplock/subtest12, when process 2 acquire grouplock before writing by process 0 there is deadlock situation. - Process 0 write will wait till process 2 release GR lock (gid=1). - Process 0 will wait for process 2 to get its lock after write completed by process 0 using MPI_RECV and here write already waiting for process 2 to release grouplock. - Process 2 release lock when process 0 notify process 2. This issue occured once on local setup, analysed issue through coredump and concluded following solution which helps to resolve this timeout. Increased sleep time from microseconds to seconds for process 1 and 2 to make sure process 0 starts writing and get PW lock. Seagate-bug-id: MRP-3751 Signed-off-by: Jadhav Vikram Reviewed-by: Alexander Lezhoev Tested-by: Alexander Lezhoev Reviewed-by: Ashish Purkar Change-Id: I1100b86dba55b2eb01c9ae61ba8f1c8e376090c8 Reviewed-on: https://review.whamcloud.com/27127 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/tests/mpi/parallel_grouplock.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lustre/tests/mpi/parallel_grouplock.c b/lustre/tests/mpi/parallel_grouplock.c index 46d05e1..dfe3cfa 100644 --- a/lustre/tests/mpi/parallel_grouplock.c +++ b/lustre/tests/mpi/parallel_grouplock.c @@ -589,12 +589,10 @@ void grouplock_test4(char *filename, int fd) * task0's write to start. */ MPI_Recv(&temp1, 1, MPI_INT, 0, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - usleep(10000); - usleep(10000); /* tell task2 to go. */ MPI_Send(&gid, 1, MPI_INT, 2, 1, MPI_COMM_WORLD); - + sleep(WAIT_TIME); read_buf(fd); MPI_Send(&gid, 1, MPI_INT, 0, 1, MPI_COMM_WORLD); @@ -603,8 +601,7 @@ void grouplock_test4(char *filename, int fd) /* Give task0 & 1 a chance to start. */ MPI_Recv(&temp1, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - usleep(25000); - usleep(25000); + sleep(2 * WAIT_TIME); if ((rc = ioctl(fd, LL_IOC_GROUP_LOCK, gid)) == -1) { sprintf(errmsg, -- 1.8.3.1