You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/02/04 13:24:23 UTC

[GitHub] [pulsar] SaturnIC opened a new issue #6215: Pulsar localrun function cannot store state

SaturnIC opened a new issue #6215: Pulsar localrun function cannot store state 
URL: https://github.com/apache/pulsar/issues/6215
 
 
   **Describe the bug**
   Hi,
   i am trying to deploy a localrun python pulsar function to a pulsar standalone docker container and connect to topics on another pulsar standalone container and i can never store any state
   successfully over the context object.
   
   If i run the same function alongside the brokers on the broker_container everything works fine,
   state can be stored and retrieved afterwards.
   
   **To Reproduce**
   If i deploy the function on the remote_container, i ll do it like this:
   ```
   /pulsar/bin/pulsar-admin functions localrun \
   --broker-service-url pulsar://broker_container:6650 \
   --tenant user1 \
   --namespace namespace1 \
   --py /pulsar_functions/function1.py \
   --name function_test \
   --user-config '{"output_topic": "persistent://user1/namespace1/output_topic"}' \
   --classname testfunction.Function1 \
   --custom-serde-inputs '{"persistent://user1/namespace1/input_topic1":"function1.MyJsonSerDe"}' \
   ```
   I can that the input msgs are indeed arriving but the state never gets stored.
   
   Did i forget to specify something? (like --broker-service-url?)
   
   **Expected behavior**
   Be able to store and retrieve state from the context object no matter if i run the 
   pulsar function on the broker cluster or a dedicated remote_container.
   
   Thank you

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] SaturnIC commented on issue #6215: [Python Function] localrun deployment cannot store state

Posted by GitBox <gi...@apache.org>.
SaturnIC commented on issue #6215: [Python Function] localrun deployment cannot store state 
URL: https://github.com/apache/pulsar/issues/6215#issuecomment-582011899
 
 
   I found the solution, the problem was indeed the --broker-service-url flag.
   I found the solution looking at the pulsar logs during function creation when using "create":
   **--state_storage_serviceurl bk://127.0.0.1:4181** 
   
   There is no example or hint about this issue anywhere in the documentary so i suggest
   to add this information too the documentary.
   
   It is no bug.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] SaturnIC edited a comment on issue #6215: [Python Function] localrun deployment cannot store state

Posted by GitBox <gi...@apache.org>.
SaturnIC edited a comment on issue #6215: [Python Function] localrun deployment cannot store state 
URL: https://github.com/apache/pulsar/issues/6215#issuecomment-582011899
 
 
   I found the solution, the problem was indeed the --broker-service-url flag.
   I found the solution looking at the pulsar logs during function creation when using "create":
   **--state_storage_serviceurl bk://127.0.0.1:4181** 
   
   This service url must be added manually when deploying a localrun function.
    
   There is no example or hint about this issue anywhere in the documentary so i suggest
   to add this information to the documentary.
   
   It is no bug.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] SaturnIC edited a comment on issue #6215: [Python Function] localrun deployment cannot store state

Posted by GitBox <gi...@apache.org>.
SaturnIC edited a comment on issue #6215: [Python Function] localrun deployment cannot store state 
URL: https://github.com/apache/pulsar/issues/6215#issuecomment-581931840
 
 
   I updated the issue description because i noticed after some experimentation that the problem seems to rest solely in the "localrun" deployment, if i deploy using "create" instead, the state works fine.
   
   But with regular cluster based functions i cannot connect to other clusters, because there is no 
   --broker-service-url!
   
   I also notice that i cannot use the pulsar-admin cli in localrun deployment of the function to list or inspect the created function.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] SaturnIC commented on issue #6215: [Python Function] localrun deployment cannot store state

Posted by GitBox <gi...@apache.org>.
SaturnIC commented on issue #6215: [Python Function] localrun deployment cannot store state 
URL: https://github.com/apache/pulsar/issues/6215#issuecomment-581931840
 
 
   I updated the issue description because i noticed after some experimentation that the problem seems to rest solely in the "localrun" deployment, if i deploy using "create" instead, everything works fine.
   
   I also notice that i cannot use the pulsar-admin cli in localrun deployment of the function to list or inspect the created function.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] sijie commented on issue #6215: [Python Function] localrun deployment cannot store state

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6215: [Python Function] localrun deployment cannot store state 
URL: https://github.com/apache/pulsar/issues/6215#issuecomment-582033558
 
 
   @SaturnIC thank you! we will update the documentation part.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] SaturnIC edited a comment on issue #6215: [Python Function] localrun deployment cannot store state

Posted by GitBox <gi...@apache.org>.
SaturnIC edited a comment on issue #6215: [Python Function] localrun deployment cannot store state 
URL: https://github.com/apache/pulsar/issues/6215#issuecomment-582011899
 
 
   I found the solution, the problem was indeed the --state_storage_serviceurl attribute.
   I found the solution looking at the pulsar logs during function creation when using "create":
   **--state_storage_serviceurl bk://127.0.0.1:4181** 
   
   This service url must be added manually when deploying a localrun function.
    
   There is no example or hint about this issue anywhere in the documentary so i suggest
   to add this information to the documentary.
   
   It is no bug.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services