You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2019/07/21 06:16:47 UTC

[pulsar] branch master updated: set go function executable when download to local (#4743)

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

sijie 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 bf58c8e  set go function executable when download to local (#4743)
bf58c8e is described below

commit bf58c8ebdecaeb2d982df069265d2e263b6f4e3d
Author: Rui Fu <fr...@users.noreply.github.com>
AuthorDate: Sun Jul 21 14:16:42 2019 +0800

    set go function executable when download to local (#4743)
    
    ### Motivation
    
    Currently golang function needs to be compiled before deploy to pulsar, so the executable permission is required when function package is downloaded to local node from bookkeeper. This PR is intent to make golang function package executable after download from bookkeeper, to make sure the function is ok to run.
---
 .../java/org/apache/pulsar/functions/worker/FunctionActioner.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
index b143a9f..e4600f9 100644
--- a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
+++ b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
@@ -242,6 +242,11 @@ public class FunctionActioner {
         } finally {
             tempPkgFile.delete();
         }
+
+        if(details.getRuntime() == Function.FunctionDetails.Runtime.GO && !pkgFile.canExecute()) {
+            pkgFile.setExecutable(true);
+            log.info("Golang function package file {} is set to executable", pkgFile);
+        }
     }
 
     private void cleanupFunctionFiles(FunctionRuntimeInfo functionRuntimeInfo) {