You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/12/31 15:04:00 UTC

[jira] [Updated] (FLINK-11235) fix thread lack when elasticsearch transport client init failed

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

ASF GitHub Bot updated FLINK-11235:
-----------------------------------
    Labels: pull-request-available  (was: )

> fix thread lack when elasticsearch transport client init failed
> ---------------------------------------------------------------
>
>                 Key: FLINK-11235
>                 URL: https://issues.apache.org/jira/browse/FLINK-11235
>             Project: Flink
>          Issue Type: Bug
>          Components: ElasticSearch Connector
>    Affects Versions: 1.7.1
>            Reporter: lamber-ken
>            Assignee: lamber-ken
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.2
>
>         Attachments: image-2018-12-31-22-31-19-081.png, image-2018-12-31-22-31-53-635.png
>
>
> h2. *elasticsearch transport sink init steps*
> 1, create client thread
> 2, try to check every host:port
> 3, if each host:port is unreachable, while throw RuntimeException
> but, because of throw RuntimeException{color:#FF0000}, the client can not close{color}, so causing thread leak
> h2. *transport client code*
> ```
> TransportClient transportClient = {color:#000080}new {color}PreBuiltTransportClient(settings);
> {color:#000080}for {color}(TransportAddress transport : ElasticsearchUtils.convertInetSocketAddresses({color:#660e7a}transportAddresses{color})) {
>  transportClient.addTransportAddress(transport);
> }
> {color:#808080}// verify that we actually are connected to a cluster
> {color}{color:#000080}if {color}(transportClient.connectedNodes().isEmpty()) {
>  {color:#000080}throw new {color}RuntimeException({color:#008000}"Elasticsearch client is not connected to any Elasticsearch nodes!"{color});
> }
> {color:#000080}return {color}transportClient;
> }
> ```
> h2. *thread leak*
> *!image-2018-12-31-22-31-19-081.png!*
> h2. *thread dump*
> !image-2018-12-31-22-31-53-635.png!
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)