Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When allowAutoTopicCreationType is set to partitioned, the function trigger cannot work normally #8239

Closed
wolfstudy opened this issue Oct 12, 2020 · 2 comments
Labels
lifecycle/stale type/bug The PR fixed a bug or issue reported a bug

Comments

@wolfstudy
Copy link
Member

Describe the bug

When allowAutoTopicCreationType is set to partitioned, the function trigger cannot work normally. The error as follows:

13:41:15.112 [AsyncHttpClient-7-1] WARN  org.apache.pulsar.client.admin.internal.FunctionsImpl - [http://localhost:8080/admin/v3/functions/public/default/example/trigger] Failed to perform http post request: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: Topic reader cannot be created on a partitioned topic
Reason: HTTP 500 Internal Server Error

The specific error location points to here

To Reproduce

  1. bin/pulsar standalone(2.6.1)
  2. bin/pulsar-admin functions create --function-config-file examples/example-function-config.yaml --jar examples/api-examples.jar

examples/example-function-config.yaml:

tenant: "public"
namespace: "default"
name: "example"
className: "org.apache.pulsar.functions.api.examples.ExclamationFunction"
inputs: ["test_src"]
userConfig:
  "PublishTopic": "test_result"

output: "test_result"
autoAck: true
parallelism: 1
  1. bin/pulsar-admin functions trigger --name example --trigger-value "hello admin pulsar" --topic test_src
  2. See error
13:41:15.112 [AsyncHttpClient-7-1] WARN  org.apache.pulsar.client.admin.internal.FunctionsImpl - [http://localhost:8080/admin/v3/functions/public/default/example/trigger] Failed to perform http post request: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: Topic reader cannot be created on a partitioned topic
Reason: HTTP 500 Internal Server Error

Expected behavior

When I set allowAutoTopicCreationType in standalone.conf to non-partitioned, the functions trigger can work normally.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Mac
  • Pulsar Broker: 2.6.1
  • JDK: 1.8
@wolfstudy
Copy link
Member Author

This problem seems to be caused by the reader being used in the trigger function, but the reader cannot subscribe to the topic of the partition.

@wolfstudy
Copy link
Member Author

It looks like #7518 is solving this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

4 participants