You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by rx...@apache.org on 2020/07/29 09:18:39 UTC

[pulsar] 13/20: Fixing go instance config port apache/pulsar#7267 (#7322)

This is an automated email from the ASF dual-hosted git repository.

rxl pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit a5a863e4a8738dd99ed3f9e9eb11aacee942db8a
Author: Bogdan <bn...@gmail.com>
AuthorDate: Sun Jul 5 08:24:18 2020 +0300

    Fixing go instance config port apache/pulsar#7267 (#7322)
    
    ## Motivation
    As described in the original issue, whenever you're trying to localrun or create a golang function - the process port is set to 0. This leads to health checks errors.
    
    ## Modifications
    The original method that returns golang cmd arguments didn't use the port variable
    from the instanceConfig parameter.
    This is a one-line modification that fixes the problem.
    
    (cherry picked from commit 8c5566434031298f316410d7f2ec0ac7373fc42b)
---
 .../src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
index ca70b42..fca33b7 100644
--- a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
+++ b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
@@ -214,6 +214,7 @@ public class RuntimeUtils {
         }
 
         goInstanceConfig.setKillAfterIdleMs(0);
+        goInstanceConfig.setPort(instanceConfig.getPort());
 
         // Parse the contents of goInstanceConfig into json form string
         ObjectMapper objectMapper = ObjectMapperFactory.getThreadLocal();