hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Shelukhin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-8829) Upgrade to Thrift 0.9.2
Date Fri, 21 Nov 2014 20:52:34 GMT

    [ https://issues.apache.org/jira/browse/HIVE-8829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14221412#comment-14221412
] 

Sergey Shelukhin commented on HIVE-8829:
----------------------------------------

Hi, I'm getting an error in tests with this on local after full clean build, even after nuking
org.apache.thrift and com.facebook from .m2; it goes away if I revert this patch. Is there
anything else that needs to be done/nuked?

{noformat}
java.lang.UnsupportedClassVersionError: com/facebook/fb303/FacebookService$Iface : Unsupported
major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:249)
	at org.apache.hadoop.hive.metastore.MetaStoreUtils.getClass(MetaStoreUtils.java:1447)
	at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:70)
	at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2674)
	at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2693)
	at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:425)
	at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:386)
	at org.apache.hadoop.hive.ql.QTestUtil.init(QTestUtil.java:712)
	at org.apache.hadoop.hive.ql.QTestUtil.<init>(QTestUtil.java:364)
	at org.apache.hadoop.hive.cli.TestCliDriver.<clinit>(TestCliDriver.java:44)
{noformat}

> Upgrade to Thrift 0.9.2
> -----------------------
>
>                 Key: HIVE-8829
>                 URL: https://issues.apache.org/jira/browse/HIVE-8829
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 0.15.0
>            Reporter: Vaibhav Gumashta
>            Assignee: Prasad Mujumdar
>              Labels: HiveServer2, metastore
>             Fix For: 0.15.0
>
>         Attachments: HIVE-8829.1.patch, HIVE-8829.1.patch
>
>
> Apache Thrift 0.9.2 was released recently (https://thrift.apache.org/download). It has
a fix for THRIFT-2660 which can cause HS2 (tcp mode) and Metastore processes to go OOM on
getting a non-thrift request when they use SASL transport. The reason ([thrift code|https://github.com/apache/thrift/blob/0.9.x/lib/java/src/org/apache/thrift/transport/TSaslTransport.java#L177]):
> {code}
>   protected SaslResponse receiveSaslMessage() throws TTransportException {
>     underlyingTransport.readAll(messageHeader, 0, messageHeader.length);
>     byte statusByte = messageHeader[0];
>     byte[] payload = new byte[EncodingUtils.decodeBigEndian(messageHeader, STATUS_BYTES)];
>     underlyingTransport.readAll(payload, 0, payload.length);
>     NegotiationStatus status = NegotiationStatus.byValue(statusByte);
>     if (status == null) {
>       sendAndThrowMessage(NegotiationStatus.ERROR, "Invalid status " + statusByte);
>     } else if (status == NegotiationStatus.BAD || status == NegotiationStatus.ERROR)
{
>       try {
>         String remoteMessage = new String(payload, "UTF-8");
>         throw new TTransportException("Peer indicated failure: " + remoteMessage);
>       } catch (UnsupportedEncodingException e) {
>         throw new TTransportException(e);
>       }
>     }
> {code}
> Basically since there are no message format checks / size checks before creating the
byte array, on getting a non-SASL message this creates a huge 
> byte array from some garbage size.
> For HS2, an attempt was made to fix it here: HIVE-6468, which never went in.  I think
for 0.15.0 it's best to upgarde to Thrift 0.9.2.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message