Changeset 18774


Ignore:
Timestamp:
02/21/17 20:16:54 (8 years ago)
Author:
Daniela Dorner
Message:
repeat query in case of deadlock
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Sourcefile.sh

    r18771 r18774  
    3636datetime=`date +%F-%H-%M-%S`
    3737
     38if [ "$transferdelay" = "" ]
     39then
     40   # setup where immediate report of problem is needed, i.e. mainly LP
     41   checknight=`date +%Y%m%d --date="-19HOUR"`
     42else
     43   # any setup where transfer might cause a delay in arrival of files
     44   checknight=`date +%Y%m%d  --date="-${transferdelay}day"`
     45fi
    3846
    3947# function to make sure that a directory is made
     
    197205      error=`echo $val | grep -E -o 'ERROR [1-9]{1,4}' | grep -E -o '[1-9]{1,4}'`
    198206      # here possible reaction to mysql error
     207      if [ $error -eq 1213 ]
     208      then
     209         printprocesslog "WARN Deadlock found. Should resend query."
     210         printprocesslog "DEBUG sendquery QUERY: [2nd try] "$query
     211         val=`mysql $sqlpwfile -s -u $us $pw --host=$ho $db -e " $query " 2>&1`
     212         checkmysql2=`echo $?`
     213         if [ $checkmysql2 -gt 0 ]
     214         then
     215            printprocesslog "ERROR could not query DB "$db" on host "$ho" with user "$us" (program: $program, function sendquery) [2nd try]"
     216            printprocesslog "MYSQLERROR [returncode: "$checkmysql"] "$val" [2nd try]"
     217            error2=`echo $val | grep -E -o 'ERROR [1-9]{1,4}' | grep -E -o '[1-9]{1,4}'`
     218            val=
     219            finish
     220         else
     221            if [ "$val" = "NULL" ]
     222            then
     223               val=
     224            fi
     225            echo $val
     226            return 0
     227         fi
     228      fi
    199229      val=
    200230      finish
     
    577607      finish
    578608   fi
    579    if [ "$transferdelay" = "" ]
    580    then
    581       # setup where immediate report of problem is needed, i.e. mainly LP
    582       checknight=`date +%Y%m%d --date="-19HOUR"`
    583    else
    584       # any setup where transfer might cause a delay in arrival of files
    585       checknight=`date +%Y%m%d  --date="-${transferdelay}day"`
    586    fi
    587609   
    588610   printprocesslog "INFO checking availability of "$1
Note: See TracChangeset for help on using the changeset viewer.