Whamcloud - gitweb
LU-9511 utils: fix parallel_grouplock test timeout 27/27127/4
authorJadhav Vikram <jadhav.vikram@seagate.com>
Wed, 15 Feb 2017 04:22:12 +0000 (09:52 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Jul 2017 03:30:43 +0000 (03:30 +0000)
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 <jadhav.vikram@seagate.com>
Reviewed-by: Alexander Lezhoev <alexander.lezhoev@seagate.com>
Tested-by: Alexander Lezhoev <alexander.lezhoev@seagate.com>
Reviewed-by: Ashish Purkar <ashish.purkar@seagate.com>
Change-Id: I1100b86dba55b2eb01c9ae61ba8f1c8e376090c8
Reviewed-on: https://review.whamcloud.com/27127
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/mpi/parallel_grouplock.c

index 46d05e1..dfe3cfa 100644 (file)
@@ -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,