<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question HiveServer2 leaks TCP sockets to datanodes in Close_wait state in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407189#M252620</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;we are experiencing a &lt;SPAN class="s1"&gt;progressive socket leak&lt;/SPAN&gt; from the &lt;STRONG&gt;LLAP&lt;/STRONG&gt; HiveServer2 daemon to HDFS DataNodes in a&lt;SPAN class="s1"&gt; cluster running HDP 3.1.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;The fd grow constantly until the limit of 6400 and the only resolution is to restart hiveserver2Interactive:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;[hive@myhost hive]$ netstat -tanp | grep "CLOSE_WAIT" | awk '{print $NF}' | awk -F'/' '{print $1}' | sort | uniq -c&lt;BR /&gt;(Not all processes could be identified, non-owned process info&lt;BR /&gt;will not be shown, you would have to be root to see it all.)&lt;BR /&gt;1734 -&lt;BR /&gt;55443 2791&lt;BR /&gt;5 49167&lt;BR /&gt;&lt;BR /&gt;[hive@myhost hive]$ ps -ef | grep 2791&lt;BR /&gt;hive 2791 1 31 Apr11 ? 6-01:44:32 /usr/jdk64/jdk1.8.0_112/bin/java -Dproc_jar -Dhdp.version=3.1.5.0-152 -Djava.net.preferIPv4Stack=true -Xloggc:/var/log/hive/hiveserverinteractive-gc-%t.log -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/grid/0/tmp/hsi_heapdump.hprof -Dhive.log.dir=/var/log/hive -Dhive.log.file=hiveserver2Interactive.log -Dzookeeper.sasl.client.username=zookeeper -Dhdp.version=3.1.5.0-152 -Xmx4096m -Dproc_hiveserver2 -Xmx10240m -Dlog4j.configurationFile=hive-log4j2.properties -Djava.util.logging.config.file=/usr/hdp/current/hive-server2/conf_llap//parquet-logging.properties -Dyarn.log.dir=/var/log/hadoop/hive -Dyarn.log.file=hadoop.log -Dyarn.home.dir=/usr/hdp/3.1.5.0-152/hadoop-yarn -Dyarn.root.logger=INFO,console -Djava.library.path=:/usr/hdp/current/hadoop-client/lib/native/Linux-amd64-64:/usr/hdp/3.1.5.0-152/hadoop/lib/native/Linux-amd64-64:/usr/hdp/current/hadoop-client/lib/native -Dhadoop.log.dir=/var/log/hadoop/hive -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=/usr/hdp/current/hadoop-client -Dhadoop.id.str=hive -Dhadoop.root.logger=INFO,console -Dhadoop.policy.file=hadoop-policy.xml -Dhadoop.security.logger=INFO,NullAppender org.apache.hadoop.util.RunJar /usr/hdp/3.1.5.0-152/hive/lib/hive-service-3.1.0.3.1.5.0-152.jar org.apache.hive.service.server.HiveServer2 --hiveconf hive.aux.jars.path=file:///usr/hdp/current/hive-server2/lib/hive-hcatalog-core.jar,file:--and other jar--&lt;/PRE&gt;&lt;P class="p1"&gt;All connections originate from LLAP and target specific datanodes:&lt;/P&gt;&lt;P class="p1"&gt;18302 ip1 1019&lt;BR /&gt;18441 ip2 1019&lt;BR /&gt;18708 ip3 1019&lt;/P&gt;&lt;P class="p1"&gt;Initially, we suspected the issue could be caused by &lt;SPAN class="s1"&gt;some UDF,&lt;/SPAN&gt; especially those that interact with HDFS (e.g. spatial or crypto functions). We tested queries that force loading of JARs like but at the moment we were &lt;SPAN class="s1"&gt;unable to reproduce the socket leak in our test cluster&lt;/SPAN&gt;, even when using the same UDFs and query patterns.&lt;/P&gt;&lt;P class="p1"&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;HDP version:&lt;/STRONG&gt;&lt;/SPAN&gt; 3.1.5&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;Hive:&lt;/STRONG&gt;&lt;/SPAN&gt; 3.1.0&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;JDK:&lt;/STRONG&gt;&lt;/SPAN&gt; 1.8.0_112&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Apr 2025 14:56:44 GMT</pubDate>
    <dc:creator>Lorenzo_F</dc:creator>
    <dc:date>2025-04-30T14:56:44Z</dc:date>
    <item>
      <title>HiveServer2 leaks TCP sockets to datanodes in Close_wait state</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407189#M252620</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;we are experiencing a &lt;SPAN class="s1"&gt;progressive socket leak&lt;/SPAN&gt; from the &lt;STRONG&gt;LLAP&lt;/STRONG&gt; HiveServer2 daemon to HDFS DataNodes in a&lt;SPAN class="s1"&gt; cluster running HDP 3.1.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;The fd grow constantly until the limit of 6400 and the only resolution is to restart hiveserver2Interactive:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;[hive@myhost hive]$ netstat -tanp | grep "CLOSE_WAIT" | awk '{print $NF}' | awk -F'/' '{print $1}' | sort | uniq -c&lt;BR /&gt;(Not all processes could be identified, non-owned process info&lt;BR /&gt;will not be shown, you would have to be root to see it all.)&lt;BR /&gt;1734 -&lt;BR /&gt;55443 2791&lt;BR /&gt;5 49167&lt;BR /&gt;&lt;BR /&gt;[hive@myhost hive]$ ps -ef | grep 2791&lt;BR /&gt;hive 2791 1 31 Apr11 ? 6-01:44:32 /usr/jdk64/jdk1.8.0_112/bin/java -Dproc_jar -Dhdp.version=3.1.5.0-152 -Djava.net.preferIPv4Stack=true -Xloggc:/var/log/hive/hiveserverinteractive-gc-%t.log -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/grid/0/tmp/hsi_heapdump.hprof -Dhive.log.dir=/var/log/hive -Dhive.log.file=hiveserver2Interactive.log -Dzookeeper.sasl.client.username=zookeeper -Dhdp.version=3.1.5.0-152 -Xmx4096m -Dproc_hiveserver2 -Xmx10240m -Dlog4j.configurationFile=hive-log4j2.properties -Djava.util.logging.config.file=/usr/hdp/current/hive-server2/conf_llap//parquet-logging.properties -Dyarn.log.dir=/var/log/hadoop/hive -Dyarn.log.file=hadoop.log -Dyarn.home.dir=/usr/hdp/3.1.5.0-152/hadoop-yarn -Dyarn.root.logger=INFO,console -Djava.library.path=:/usr/hdp/current/hadoop-client/lib/native/Linux-amd64-64:/usr/hdp/3.1.5.0-152/hadoop/lib/native/Linux-amd64-64:/usr/hdp/current/hadoop-client/lib/native -Dhadoop.log.dir=/var/log/hadoop/hive -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=/usr/hdp/current/hadoop-client -Dhadoop.id.str=hive -Dhadoop.root.logger=INFO,console -Dhadoop.policy.file=hadoop-policy.xml -Dhadoop.security.logger=INFO,NullAppender org.apache.hadoop.util.RunJar /usr/hdp/3.1.5.0-152/hive/lib/hive-service-3.1.0.3.1.5.0-152.jar org.apache.hive.service.server.HiveServer2 --hiveconf hive.aux.jars.path=file:///usr/hdp/current/hive-server2/lib/hive-hcatalog-core.jar,file:--and other jar--&lt;/PRE&gt;&lt;P class="p1"&gt;All connections originate from LLAP and target specific datanodes:&lt;/P&gt;&lt;P class="p1"&gt;18302 ip1 1019&lt;BR /&gt;18441 ip2 1019&lt;BR /&gt;18708 ip3 1019&lt;/P&gt;&lt;P class="p1"&gt;Initially, we suspected the issue could be caused by &lt;SPAN class="s1"&gt;some UDF,&lt;/SPAN&gt; especially those that interact with HDFS (e.g. spatial or crypto functions). We tested queries that force loading of JARs like but at the moment we were &lt;SPAN class="s1"&gt;unable to reproduce the socket leak in our test cluster&lt;/SPAN&gt;, even when using the same UDFs and query patterns.&lt;/P&gt;&lt;P class="p1"&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;HDP version:&lt;/STRONG&gt;&lt;/SPAN&gt; 3.1.5&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;Hive:&lt;/STRONG&gt;&lt;/SPAN&gt; 3.1.0&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;JDK:&lt;/STRONG&gt;&lt;/SPAN&gt; 1.8.0_112&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 14:56:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407189#M252620</guid>
      <dc:creator>Lorenzo_F</dc:creator>
      <dc:date>2025-04-30T14:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: HiveServer2 leaks TCP sockets to datanodes in Close_wait state</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407200#M252623</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/122440"&gt;@Lorenzo_F&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our Hive experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38161"&gt;@cravani&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/45798"&gt;@james_jones&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/92016"&gt;@ggangadharan&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;/P&gt;
&lt;P&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 17:11:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407200#M252623</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2025-04-30T17:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: HiveServer2 leaks TCP sockets to datanodes in Close_wait state</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407370#M252635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/122440"&gt;@Lorenzo_F&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It could be due to the below bug -&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/HIVE-22981" target="_blank"&gt;https://issues.apache.org/jira/browse/HIVE-22981&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You may need to reproduce the issue and take heap dump to confirm it.&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2025 12:58:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407370#M252635</guid>
      <dc:creator>shubham_sharma</dc:creator>
      <dc:date>2025-05-01T12:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: HiveServer2 leaks TCP sockets to datanodes in Close_wait state</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407742#M252636</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80101"&gt;@shubham_sharma&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;i've tried to reproduce the issue creating a test avro table, quering it i've found that generate close_wait socket.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2025 08:51:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HiveServer2-leaks-TCP-sockets-to-datanodes-in-Close-wait/m-p/407742#M252636</guid>
      <dc:creator>Lorenzo_F</dc:creator>
      <dc:date>2025-05-02T08:51:35Z</dc:date>
    </item>
  </channel>
</rss>

