Skip to content

[bug](function-go-runtime): The runtime of instance-conf is incorrect #12477

@ericsyh

Description

@ericsyh

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go build a golang-function.
  2. Local run the go-function bin/pulsar-admin functions localrun --go /home/ericsyh/apache-pulsar-2.8.1/func-go/main --inputs persistent://public/default/input --output persistent://public/default/output --tenant public --namespace default --name GoFunction
  3. See the output of instance-conf

Expected behavior
The runtime info of instance-conf should be the GO.

Screenshots
But the current behavior the runtime info is 0:

09:09:37.662 [main] INFO  org.apache.pulsar.functions.runtime.process.ProcessRuntimeFactory - Java instance jar location is not defined, using the location defined in system environment : /home/ericsyh/apache-pulsar-2.8.1/instances/java-instance.jar
09:09:37.664 [main] INFO  org.apache.pulsar.functions.runtime.process.ProcessRuntimeFactory - Python instance file location is not defined using the location defined in system environment : /home/ericsyh/apache-pulsar-2.8.1/instances/python-instance/python_instance_main.py
09:09:37.664 [main] INFO  org.apache.pulsar.functions.runtime.process.ProcessRuntimeFactory - No extra dependencies location is defined in either function worker config or system environment
09:09:37.687 [main] INFO  org.apache.pulsar.functions.runtime.RuntimeSpawner - public/default/GoFunction-0 RuntimeSpawner starting function
09:09:37.687 [main] INFO  org.apache.pulsar.functions.runtime.process.ProcessRuntime - Creating function log directory /home/ericsyh/apache-pulsar-2.8.1/logs/functions/public/default/GoFunction
09:09:37.688 [main] INFO  org.apache.pulsar.functions.runtime.process.ProcessRuntime - Created or found function log directory /home/ericsyh/apache-pulsar-2.8.1/logs/functions/public/default/GoFunction
09:09:37.688 [main] INFO  org.apache.pulsar.functions.runtime.process.ProcessRuntime - ProcessBuilder starting the process with args /home/ericsyh/apache-pulsar-2.8.1/func-go/main -instance-conf {"pulsarServiceURL":"pulsar://192.168.0.228:6650","instanceID":0,"funcID":"37c54f4f-c2c7-4e92-bc14-63d6a153cd21","funcVersion":"3703efac-d9be-4372-8c17-1a64808392f8","maxBufTuples":1024,"port":37654,"clusterName":"local","killAfterIdleMs":0,"expectedHealthCheckInterval":0,"tenant":"public","nameSpace":"default","name":"GoFunction","className":"","logTopic":"","processingGuarantees":0,"secretsMap":"","userConfig":"","runtime":0,"autoAck":true,"parallelism":1,"subscriptionType":0,"timeoutMs":0,"subscriptionName":"","cleanupSubscription":true,"sourceSpecsTopic":"persistent://public/default/input","sourceSchemaType":"","receiverQueueSize":0,"sinkSpecsTopic":"persistent://public/default/output","sinkSchemaType":"","cpu":1.0,"ram":1073741824,"disk":10737418240,"maxMessageRetries":0,"deadLetterTopic":"","metricsPort":44147,"regexPatternSubscription":false}
09:09:37.693 [main] INFO  org.apache.pulsar.functions.runtime.process.ProcessRuntime - Started process successfully
2021/10/25 09:09:37.694 log.go:46: [info] The default config file path is: conf/conf.yaml
2021/10/25 09:09:37.695 asm_amd64.s:1357: [info] [Connecting to broker] remote_addr=pulsar://192.168.0.228:6650
2021/10/25 09:09:37.695 asm_amd64.s:1357: [info] [TCP connection established] remote_addr=pulsar://192.168.0.228:6650 local_addr=192.168.0.228:55530
2021/10/25 09:09:37.696 asm_amd64.s:1357: [info] [Connection is ready] remote_addr=pulsar://192.168.0.228:6650 local_addr=192.168.0.228:55530
2021/10/25 09:09:37.697 asm_amd64.s:1357: [info] [Connecting to broker] remote_addr=pulsar://ecs-e324:6650
2021/10/25 09:09:37.698 asm_amd64.s:1357: [info] [TCP connection established] remote_addr=pulsar://ecs-e324:6650 local_addr=127.0.0.1:34898
2021/10/25 09:09:37.702 asm_amd64.s:1357: [info] [Connection is ready] remote_addr=pulsar://ecs-e324:6650 local_addr=127.0.0.1:34898
2021/10/25 09:09:37.703 asm_amd64.s:1357: [info] [Created producer] topic=persistent://public/default/output producerID=1 producer_name=pulsar-cluster-7-331 cnx=127.0.0.1:34898 -> 127.0.1.1:6650
2021/10/25 09:09:37.704 consumer_impl.go:326: [info] [Connected consumer] name=svwup topic=persistent://public/default/input subscription=public/default/GoFunction consumerID=1
2021/10/25 09:09:37.704 asm_amd64.s:1357: [info] [Created consumer] subscription=public/default/GoFunction consumerID=1 name=svwup topic=persistent://public/default/input
2021/10/25 09:09:37.704 log.go:46: [info] Serving InstanceCommunication on port 37654
2021/10/25 09:09:37.704 log.go:46: [info] Starting metrics server on port 44147
^C09:09:46.767 [main] INFO  org.apache.pulsar.functions.LocalRunner - RuntimeSpawner quit because of

And the https://github.com/apache/pulsar/blob/master/pulsar-function-go/pb/Function.pb.go#L240 indicates that 0 is JAVA

Desktop (please complete the following information):

  • Ubuntu Server 16

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions