[ 
https://issues.apache.org/jira/browse/GEODE-7864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17214058#comment-17214058
 ] 

ASF GitHub Bot commented on GEODE-7864:
---------------------------------------

DonalEvans commented on a change in pull request #5582:
URL: https://github.com/apache/geode/pull/5582#discussion_r504835943



##########
File path: 
geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java
##########
@@ -200,21 +200,28 @@ public Object requestToServer(HostAndPort addr, Object 
request, int timeout,
       out.flush();
 
       if (replyExpected) {
-        DataInputStream in = new DataInputStream(sock.getInputStream());
-        if (debugVersionMessage != null && logger.isDebugEnabled()) {
-          logger.debug(debugVersionMessage);
-        }
-        in = new VersionedDataInputStream(in, serverVersion);
+        DataInputStream in = null;
         try {

Review comment:
       Good catch, thanks.

##########
File path: 
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java
##########
@@ -101,26 +101,36 @@ public ResultModel deploy(
     for (DistributedMember member : targetMembers) {
       List<RemoteInputStream> remoteStreams = new ArrayList<>();
       List<String> jarNames = new ArrayList<>();
-      for (String jarFullPath : jarFullPaths) {
-        remoteStreams
-            .add(exporter.export(new SimpleRemoteInputStream(new 
FileInputStream(jarFullPath))));
-        jarNames.add(FilenameUtils.getName(jarFullPath));
-      }
-
-      // this deploys the jars to all the matching servers
-      ResultCollector<?, ?> resultCollector =
-          executeFunction(this.deployFunction, new Object[] {jarNames, 
remoteStreams}, member);
-
-      @SuppressWarnings("unchecked")
-      final List<List<Object>> resultCollectorResult =
-          (List<List<Object>>) resultCollector.getResult();
-      results.add(resultCollectorResult.get(0));
+      try {
+        for (String jarFullPath : jarFullPaths) {
+          FileInputStream fileInputStream = null;
+          try {
+            fileInputStream = new FileInputStream(jarFullPath);
+            remoteStreams.add(exporter.export(new 
SimpleRemoteInputStream(fileInputStream)));
+            jarNames.add(FilenameUtils.getName(jarFullPath));
+          } catch (Exception ex) {
+            if (fileInputStream != null) {
+              fileInputStream.close();

Review comment:
       Fixed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Code improvement refactoring
> ----------------------------
>
>                 Key: GEODE-7864
>                 URL: https://issues.apache.org/jira/browse/GEODE-7864
>             Project: Geode
>          Issue Type: Improvement
>            Reporter: Nabarun Nag
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 13h 10m
>  Remaining Estimate: 0h
>
> This is a placeholder ticket.
>  * this is used to do refactoring.
>  * this ticket number is used to number the commit message.
>  * this ticket will never be closed.
>  * it will be used to mark improvements like correcting spelling mistakes, 
> efficient java code, etc.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to