You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@slider.apache.org by "Gour Saha (JIRA)" <ji...@apache.org> on 2015/06/16 02:20:00 UTC

[jira] [Created] (SLIDER-904) Resource leak reported by coverity scan results

Gour Saha created SLIDER-904:
--------------------------------

             Summary: Resource leak reported by coverity scan results
                 Key: SLIDER-904
                 URL: https://issues.apache.org/jira/browse/SLIDER-904
             Project: Slider
          Issue Type: Bug
          Components: core
    Affects Versions: Slider 0.80
            Reporter: Gour Saha


Coverity reported the following issues.

{code:title=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  }
{code}

{code:title=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
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)