[ 
https://issues.apache.org/jira/browse/KAFKA-12904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Hauch updated KAFKA-12904:
----------------------------------
    Description: 
The fix for KAFKA-9374 changed how the `ConnectorPluginsResource` and its 
method to validate connector configurations used the 
`ConnectorsResource.REQUEST_TIMEOUT_MS` constant (90 seconds). However, in 
doing so it introduced a bug where the timeout was actually 1000x longer than 
desired/specified.

In particular, the following line is currently:

{code:java}
            return 
validationCallback.get(ConnectorsResource.REQUEST_TIMEOUT_MS, TimeUnit.SECONDS);
{code}

but should be:
{code:java}
            return 
validationCallback.get(ConnectorsResource.REQUEST_TIMEOUT_MS, 
TimeUnit.MILLISECONDS);
{code}

Users may run into this whenever validating a connector configuration where the 
connector implementation takes more than the 90 seconds to actually validate 
the configuration. 
* Without this fix, the `PUT /connector-plugins/(string:name)/config/validate` 
REST requests might **_not_** return `500 Internal Server Error` and may block 
(the request thread) for a long period of time. 
* With this fix, the `PUT /connector-plugins/(string:name)/config/validate` 
REST requests might **_not_** return `500 Internal Server Error` if the 
connector does not complete the validation of a connector configuration within 
90 seconds.

The user will not see a difference between the behavior before or after this 
fix if/when the connectors complete validation of connector configurations 
before 90 seconds, since the method will return those results to the client.


  was:
The fix for KAFKA-9374 changed how the `ConnectorPluginsResource` and its 
method to validate connector configurations used the 
`ConnectorsResource.REQUEST_TIMEOUT_MS` constant (90 seconds). However, in 
doing so it introduced a bug where the timeout was actually 1000x longer than 
desired/specified.

In particular, the following line is currently:

{code:java}
            return 
validationCallback.get(ConnectorsResource.REQUEST_TIMEOUT_MS, TimeUnit.SECONDS);
{code}

but should be:
{code:java}
            return 
validationCallback.get(ConnectorsResource.REQUEST_TIMEOUT_MS, 
TimeUnit.MILLISECONDS);
{code}

Users may run into this whenever validating a connector configuration where the 
connector implementation takes more than the 90 seconds to actually validate 
the configuration. 
* Without this fix, the `PUT /connector-plugins/(string:name)/config/validate` 
REST requests might **_not_** return `500 Internal Server Error` and may block 
(the request thread) for a long period of time. 
* With this fix, the `PUT /connector-plugins/(string:name)/config/validate` 
REST requests might **_not_** return `500 Internal Server Error` if the 
connector does not complete the validation of a connector configuration within 
90 seconds.



> Connect's validate REST endpoint uses incorrect timeout
> -------------------------------------------------------
>
>                 Key: KAFKA-12904
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12904
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>    Affects Versions: 2.6.0
>            Reporter: Randall Hauch
>            Assignee: Randall Hauch
>            Priority: Major
>
> The fix for KAFKA-9374 changed how the `ConnectorPluginsResource` and its 
> method to validate connector configurations used the 
> `ConnectorsResource.REQUEST_TIMEOUT_MS` constant (90 seconds). However, in 
> doing so it introduced a bug where the timeout was actually 1000x longer than 
> desired/specified.
> In particular, the following line is currently:
> {code:java}
>             return 
> validationCallback.get(ConnectorsResource.REQUEST_TIMEOUT_MS, 
> TimeUnit.SECONDS);
> {code}
> but should be:
> {code:java}
>             return 
> validationCallback.get(ConnectorsResource.REQUEST_TIMEOUT_MS, 
> TimeUnit.MILLISECONDS);
> {code}
> Users may run into this whenever validating a connector configuration where 
> the connector implementation takes more than the 90 seconds to actually 
> validate the configuration. 
> * Without this fix, the `PUT 
> /connector-plugins/(string:name)/config/validate` REST requests might 
> **_not_** return `500 Internal Server Error` and may block (the request 
> thread) for a long period of time. 
> * With this fix, the `PUT /connector-plugins/(string:name)/config/validate` 
> REST requests might **_not_** return `500 Internal Server Error` if the 
> connector does not complete the validation of a connector configuration 
> within 90 seconds.
> The user will not see a difference between the behavior before or after this 
> fix if/when the connectors complete validation of connector configurations 
> before 90 seconds, since the method will return those results to the client.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to