You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pv...@apache.org on 2019/09/26 12:15:56 UTC

[hive] branch master updated: HIVE-22231: Hive query with big size via knox fails with Broken pipe Write failed (Denys Kuzmenko via Peter Vary)

This is an automated email from the ASF dual-hosted git repository.

pvary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 50862a6  HIVE-22231: Hive query with big size via knox fails with Broken pipe Write failed (Denys Kuzmenko via Peter Vary)
50862a6 is described below

commit 50862a6e30e2c5a8a5690790d2054c8a3d4f2a49
Author: denys kuzmenko <dk...@cloudera.com>
AuthorDate: Thu Sep 26 14:14:16 2019 +0200

    HIVE-22231: Hive query with big size via knox fails with Broken pipe Write failed (Denys Kuzmenko via Peter Vary)
---
 .../org/apache/hive/service/cli/thrift/ThriftHttpServlet.java  | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java
index f5411c6..e2231c2 100644
--- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java
+++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java
@@ -18,6 +18,7 @@
 
 package org.apache.hive.service.cli.thrift;
 
+import java.io.EOFException;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.security.PrivilegedExceptionAction;
@@ -35,6 +36,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.core.NewCookie;
 
+import com.google.common.io.ByteStreams;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.binary.StringUtils;
 import org.apache.hadoop.hive.conf.HiveConf;
@@ -239,6 +241,14 @@ public class ThriftHttpServlet extends TServlet {
       if (!(e instanceof HttpEmptyAuthenticationException)) {
         LOG.error("Error: ", e);
       }
+      // Wait until all the data is received and then respond with 401
+      if (request.getContentLength() < 0) {
+        try {
+          ByteStreams.skipFully(request.getInputStream(), Integer.MAX_VALUE);
+        } catch (EOFException ex) {
+          LOG.info(ex.getMessage());
+        }
+      }
       // Send a 401 to the client
       response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
       if(isKerberosAuthMode(authType)) {