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

scripts don't check return code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.1.0
    • replication (scripts)
    • 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

        1. solr-scripts-solr-62.patch
          2 kB
          William Au

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: