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/05 05:24:30 UTC

[pulsar] branch master updated: 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 master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c55664  Fixing go instance config port apache/pulsar#7267 (#7322)
8c55664 is described below

commit 8c5566434031298f316410d7f2ec0ac7373fc42b
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.
---
 .../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();