Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28085

Fix "kill processes" function in evergreen.yml

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.5.6
    • 3.2.12, 3.4.2, 3.5.3
    • Testing Infrastructure
    • Fully Compatible
    • ALL
    • v3.4, v3.2, v3.0
    • TIG 2017-04-17
    • 0

    Description

      The "kill processes" function has a coding error:

      pgrep_list_full=$(pgrep -f --list-full ".*" 2>&1 > /dev/null)
      if [ -z "$pgrep_list_full" ]; then
      ...
      fi
      

      Since stdout & stderr are directed to /dev/null, this will always be true.

      Similarly, this test is also flawed:

      grep=grep
      grep_extended=$(echo "a" | $grep -E "(a)" 2>&1 > /dev/null)
      if [ ! -z "$grep_extended" ]; then
      ...
      fi
      

      The fix is to just direct stderr to /dev/null:

      pgrep_list_full=$(pgrep -f --list-full ".*" 2> /dev/null)
      if [ ! -z "$pgrep_list_full" ]; then
      ...
      fi
      ...
      grep_extended=$(echo "a" | $grep -E "(a)" 2> /dev/null)
      ...
      

      An alternate fix would be to test for $?

      Attachments

        Activity

          People

            jonathan.abrahams Jonathan Abrahams
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: