Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 820EC200C92 for ; Mon, 12 Jun 2017 10:22:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 80B46160BD9; Mon, 12 Jun 2017 08:22:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C8163160BD6 for ; Mon, 12 Jun 2017 10:22:09 +0200 (CEST) Received: (qmail 2044 invoked by uid 500); 12 Jun 2017 08:22:09 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 2035 invoked by uid 99); 12 Jun 2017 08:22:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2017 08:22:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 878BE18040F for ; Mon, 12 Jun 2017 08:22:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id jOX_YbnSogdG for ; Mon, 12 Jun 2017 08:22:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C7FBC5F5B8 for ; Mon, 12 Jun 2017 08:22:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 08DF0E02C7 for ; Mon, 12 Jun 2017 08:22:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 147EF21E0E for ; Mon, 12 Jun 2017 08:22:00 +0000 (UTC) Date: Mon, 12 Jun 2017 08:22:00 +0000 (UTC) From: "Rui Li (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-16854) SparkClientFactory is locked too aggressively MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 12 Jun 2017 08:22:10 -0000 [ https://issues.apache.org/jira/browse/HIVE-16854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rui Li updated HIVE-16854: -------------------------- Resolution: Fixed Fix Version/s: 3.0.0 Status: Resolved (was: Patch Available) Pushed to master. Thanks Xuefu for the review. > SparkClientFactory is locked too aggressively > --------------------------------------------- > > Key: HIVE-16854 > URL: https://issues.apache.org/jira/browse/HIVE-16854 > Project: Hive > Issue Type: Bug > Components: Spark > Affects Versions: 1.1.0 > Reporter: Xuefu Zhang > Assignee: Rui Li > Fix For: 3.0.0 > > Attachments: 15763.jstack, HIVE-16854.2.patch, HIVE-16854.patch > > > Most methods in SparkClientFactory are synchronized on the SparkClientFactory singleton. However, some methods are very expensive, such as createClient(), which returns a SparkClientImpl instance. However, creating a SparkClientImpl instance requires starting a remote driver to connect back to RPCServer. This process can take a long time such as in case of a busy yarn queue. When this happens, all pending calls on SparkClientFactory will have to wait for a long time. > In our case, hive.spark.client.server.connect.timeout is set to 1hr. This makes some queries waiting for hours before starting. > The current implementation seems pretty much making all remote driver launches serialized. If one of them takes time, the following ones will have to wait. > HS2 stacktrace is attached for reference. It's based on earlier version of Hive, so the line numbers might be slightly off. The following shows the locking effect: > {code} > xuefu@hadoopservice20-sjc1:~$ grep org.apache.hive.spark.client.SparkClientFactory 15763.jstack > at org.apache.hive.spark.client.SparkClientFactory.createClient(SparkClientFactory.java:79) > - waiting to lock <0x00007f78fa1a9cc0> (a java.lang.Class for org.apache.hive.spark.client.SparkClientFactory) > at org.apache.hive.spark.client.SparkClientFactory.createClient(SparkClientFactory.java:79) > - waiting to lock <0x00007f78fa1a9cc0> (a java.lang.Class for org.apache.hive.spark.client.SparkClientFactory) > at org.apache.hive.spark.client.SparkClientFactory.createClient(SparkClientFactory.java:80) > - locked <0x00007f78fa1a9cc0> (a java.lang.Class for org.apache.hive.spark.client.SparkClientFactory) > at org.apache.hive.spark.client.SparkClientFactory.createClient(SparkClientFactory.java:79) > - waiting to lock <0x00007f78fa1a9cc0> (a java.lang.Class for org.apache.hive.spark.client.SparkClientFactory) > at org.apache.hive.spark.client.SparkClientFactory.createClient(SparkClientFactory.java:79) > - waiting to lock <0x00007f78fa1a9cc0> (a java.lang.Class for org.apache.hive.spark.client.SparkClientFactory) > at org.apache.hive.spark.client.SparkClientFactory.createClient(SparkClientFactory.java:79) > - waiting to lock <0x00007f78fa1a9cc0> (a java.lang.Class for org.apache.hive.spark.client.SparkClientFactory) > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)