Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9560

Connector::validate is utilized concurrently by the framework, but not documented as thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • connect
    • None

    Description

      Requests to the PUT /connector-plugins/{connectorType}/config/validate endpoint are delegated to the herder, which caches connector instances that are used during config validation. This has the effect that, should concurrent requests to that endpoint occur for the same connector type, the same connector instance may be responsible for validating those configurations concurrently (may instead of will because there is also a race condition in the AbstractHerder::getConnector method that potentially fails to detect that an instance of the connector has already been created and, as a result, creates a second instance KAFKA-12704).

      This is slightly problematic because the Connector::validate method is not marked as thread-safe. However, because a lot of connectors out there tend to use the default implementation for that method, it's probably not super urgent that we patch this immediately.

      A couple of options are:

      1. Update the docs for that method to specify that it must be thread-safe
      2. Rewrite the connector validation logic in the framework to avoid concurrently invoking Connector::validate on the same instance.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ChrisEgerton Chris Egerton
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: