Uploaded image for project: 'Slider'
  1. Slider
  2. SLIDER-904

Resource leak reported by coverity scan results

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Slider 0.80
    • Fix Version/s: Slider 0.81
    • Component/s: core
    • Labels:
      None

      Description

      Coverity reported the following issues.

      RpcBinder.java
      169    while (application != null && 
      170           (state= application.getYarnApplicationState()).equals(
      171             YarnApplicationState.RUNNING)) {
      172
      173      try {
         	
      CID 68074 (#1 of 1): Resource leak (RESOURCE_LEAK)
      6. leaked_resource: Variable timeout going out of scope leaks the resource it refers to.
      174        return getProxy(conf, application, rpcTimeout);
      175      } catch (IOException e) {
      176        if (connectTimeout <= 0 || timeout.getLimitExceeded()) {
      177          throw e;
      178        }
      179        exception = e;
      180      } catch (YarnException e) {
      181        if (connectTimeout <= 0 || timeout.getLimitExceeded()) {
      182          throw e;
      183        }
      184        exception = e;
      185
      186      }
      187      //at this point: app failed to work
      188      log.debug("Could not connect to {}. Waiting for getting the latest AM address...",
      189                appId);
      190      Thread.sleep(1000);
      191      //or get the app report
      192      application =
      193        rmClient.getApplicationReport(GetApplicationReportRequest.newInstance(
      194          appId)).getApplicationReport();
      195    }
      196    //get here if the app is no longer running. Raise a specific
      197    //exception but init it with the previous failure
      198    throw new BadClusterStateException(
      199                            exception,
      200                            ErrorStrings.E_FINISHED_APPLICATION, appId, state );
      201  }
      
      SliderClusterOperations.java
      278        } else {
      279          try {
      280            Thread.sleep(1000);
      281          } catch (InterruptedException ignored) {
      282            // ignored
      283          }
      284        }
      285      }
         	9. Jumping back to the beginning of the loop
      286    }
         	
      CID 68066 (#1 of 1): Resource leak (RESOURCE_LEAK)
      11. leaked_resource: Variable duration going out of scope leaks the resource it refers to.
      287    return state;
      288  }
      289  
      290  public boolean flex(ConfTree resources) throws IOException, YarnException {
      291    Messages.FlexClusterRequestProto request =
      292      Messages.FlexClusterRequestProto.newBuilder()
      293              .setClusterSpec(resources.toJson())
      294              .build();
      295
      

        Attachments

          Activity

            People

            • Assignee:
              gsaha Gour Saha
              Reporter:
              gsaha Gour Saha
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: