Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-62

scripts don't check return code

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: replication (scripts)
    • Labels:
      None

      Description

      Solr scripts that post commands to solr don't check the return code.

      The scripts (like optimize) currently follow this pattern:

      rs=`curl http://localhost:5051/update -s -d "<optimize/>"`
      if [[ $? != 0 ]]
      then
      [...]
      fi

      1. check status of optimize request
        rc=`echo $rs|cut -f2 -d'"'`
        if [[ $? != 0 ]]
        then
        [...]

      $rc is never checked. In addition, the line that grabs rc appears pretty
      fragile by depending on an exact field column. Unless we have a simple command
      line XML parser, how about checking for the return code this way:

      echo $rs | grep '<response.*status="0"' > /dev/null 2>&1
      if [[ $? != 0 ]]
      then
      [...]

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yseeley@gmail.com Yonik Seeley
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: