Uploaded image for project: 'Apache Hudi'
  1. Apache Hudi
  2. HUDI-596

KafkaConsumer need to be closed

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      `offsetGen.getNextOffsetRanges` will is called periodically in DeltaStreamer application, and it will `new KafkaConsumer(kafkaParams)` without close, and Exception will throw after a while.

      ```
      java.net.SocketException: Too many open files
      at sun.nio.ch.Net.socket0(Native Method)
      at sun.nio.ch.Net.socket(Net.java:411)
      at sun.nio.ch.Net.socket(Net.java:404)
      at sun.nio.ch.SocketChannelImpl.<init>(SocketChannelImpl.java:105)
      at sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:60)
      at java.nio.channels.SocketChannel.open(SocketChannel.java:145)
      at org.apache.kafka.common.network.Selector.connect(Selector.java:211)
      at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:864)
      at org.apache.kafka.clients.NetworkClient.ready(NetworkClient.java:265)
      at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.trySend(ConsumerNetworkClient.java:485)
      at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:261)
      at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:242)
      at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:218)
      at org.apache.kafka.clients.consumer.internals.Fetcher.getTopicMetadata(Fetcher.java:274)
      at org.apache.kafka.clients.consumer.KafkaConsumer.partitionsFor(KafkaConsumer.java:1774)
      at org.apache.kafka.clients.consumer.KafkaConsumer.partitionsFor(KafkaConsumer.java:1742)
      at org.apache.hudi.utilities.sources.helpers.KafkaOffsetGen.getNextOffsetRanges(KafkaOffsetGen.java:177)
      at org.apache.hudi.utilities.sources.JsonKafkaSource.fetchNewData(JsonKafkaSource.java:56)
      at org.apache.hudi.utilities.sources.Source.fetchNext(Source.java:73)
      at org.apache.hudi.utilities.deltastreamer.SourceFormatAdapter.fetchNewDataInRowFormat(SourceFormatAdapter.java:107)
      at org.apache.hudi.utilities.deltastreamer.DeltaSync.readFromSource(DeltaSync.java:288)
      at org.apache.hudi.utilities.deltastreamer.DeltaSync.syncOnce(DeltaSync.java:226)
      ```

        Attachments

          Activity

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

              Dates

              • Created:
                Updated:
                Resolved:

              Time Tracking

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

                Issue deployment