Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-13689

Rest High Level Client for Elasticsearch6.x connector leaks threads if no connection could be established

    XMLWordPrintableJSON

Details

    Description

      If the created Elastic Search Rest High Level Client(rhlClient) is unreachable, Current code throws RuntimeException. But, it doesn't close the client which causes thread leak.

       

      Current Code

      if (!rhlClient.ping()) {

           throw new RuntimeException("There are no reachable Elasticsearch nodes!");

      }

       

      Change Needed

      rhlClient needs to be closed.

       

      Steps to Reproduce

      1. Add the ElasticSearch Sink to the stream. Start the Flink program without starting the ElasticSearch. 

      2. Program will give error: "Too many open files" and it doesn't write even though you start the Elastic Search later.

       

      Attachments

        Activity

          People

            melmoth static-max
            rishi55 Rishindra Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m