Skip to content

Sending "stop" to a connector should be idempotent. #18119

@pgier

Description

@pgier

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

We're running pulsar in Kubernetes and ran into a situation where the "stop" command was called on a connector (a sink in this case) but the kubernetes statefulset was not removed. Calling "stop" again on the same connector returned an HTTP 400 error with "operation not permitted" because pulsar thought that the connector was already stopped.

I was able to work around this by first calling "start" on the connector, either from the pulsar-admin CLI or the rest endpoint, and then calling "stop" again. This time the stateful set was removed.

Solution

Instead of returning different responses (HTTP 200 vs. 400) depending on the state of the connector, I think it would be better if a "stop" call on an already stopped connector would try again to stop the connector and clean up any hanging resources, and then return a 200 if everything went ok. So several calls to stop on a connector in a row should all return HTTP 200 assuming that the connector was stopped successfully.

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions