Solr
  1. Solr
  2. SOLR-62

scripts don't check return code

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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
      [...]

        Activity

        Hide
        Hoss Man added a comment -

        This bug was modified as part of a bulk update using the criteria...

        • Marked ("Resolved" or "Closed") and "Fixed"
        • Had no "Fix Version" versions
        • Was listed in the CHANGES.txt for 1.1

        The Fix Version for all 38 issues found was set to 1.1, email notification
        was suppressed to prevent excessive email.

        For a list of all the issues modified, search jira comments for this
        (hopefully) unique string: 20080415hossman3

        Show
        Hoss Man added a comment - This bug was modified as part of a bulk update using the criteria... Marked ("Resolved" or "Closed") and "Fixed" Had no "Fix Version" versions Was listed in the CHANGES.txt for 1.1 The Fix Version for all 38 issues found was set to 1.1, email notification was suppressed to prevent excessive email. For a list of all the issues modified, search jira comments for this (hopefully) unique string: 20080415hossman3
        Hide
        Bill Au added a comment -

        patch committed.

        Show
        Bill Au added a comment - patch committed.
        Hide
        Bill Au added a comment -

        Attached patch for proposed solution.
        Note that the XML response of the commit and optimize is a little different from that of a query:

        <result status="0"></result>

        Show
        Bill Au added a comment - Attached patch for proposed solution. Note that the XML response of the commit and optimize is a little different from that of a query: <result status="0"></result>

          People

          • Assignee:
            Unassigned
            Reporter:
            Yonik Seeley
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development