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

Mehrdad Karami updated KAFKA-16076:
-----------------------------------
    Description: 
In RestClient class, httpRequest is being called with different threads. An 
InterruptedException in case of failure is used to handle its specific 
exceptions, nevertheless it's forgot to call Thread.currentThread().interrupt().

In general, it's a good practice to call this so the rest of code know the 
thread was interrupted already.
Note:
Some methods that cause a thread to wait or sleep (like {{{}Thread.sleep(){}}}) 
will check this flag. If they see it’s set, they’ll stop waiting/sleeping and 
throw an {{InterruptedException.}}

  was:
In RestClient class, `httpRequest` is being called with different threads. An 
`InterruptedException` in case of failure is used to handle its specific 
exceptions, nevertheless it's forgot to call 
`Thread.currentThread().interrupt()`.

In general, it's a good practice to call this so the rest of code know the 
thread was interrupted already.
Note:
Some methods that cause a thread to wait or sleep (like 
`{{{}Thread.sleep()`{}}}) will check this flag. If they see it’s set, they’ll 
stop waiting/sleeping and throw an `{{{}InterruptedException`{}}}


> RestClient Interrupting the thread in case of InterruptedException
> ------------------------------------------------------------------
>
>                 Key: KAFKA-16076
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16076
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>            Reporter: Mehrdad Karami
>            Priority: Minor
>              Labels: easyfix
>
> In RestClient class, httpRequest is being called with different threads. An 
> InterruptedException in case of failure is used to handle its specific 
> exceptions, nevertheless it's forgot to call 
> Thread.currentThread().interrupt().
> In general, it's a good practice to call this so the rest of code know the 
> thread was interrupted already.
> Note:
> Some methods that cause a thread to wait or sleep (like 
> {{{}Thread.sleep(){}}}) will check this flag. If they see it’s set, they’ll 
> stop waiting/sleeping and throw an {{InterruptedException.}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to