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 C07BA200D27 for ; Wed, 25 Oct 2017 19:15:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BEE99160BDA; Wed, 25 Oct 2017 17:15:06 +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 1211C1609CE for ; Wed, 25 Oct 2017 19:15:05 +0200 (CEST) Received: (qmail 75125 invoked by uid 500); 25 Oct 2017 17:15:05 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 75116 invoked by uid 99); 25 Oct 2017 17:15:05 -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; Wed, 25 Oct 2017 17:15:05 +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 5E5FA1806C0 for ; Wed, 25 Oct 2017 17:15:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id giLajRdP0NBX for ; Wed, 25 Oct 2017 17:15:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1141B5FD01 for ; Wed, 25 Oct 2017 17:15:03 +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 95C17E0E85 for ; Wed, 25 Oct 2017 17:15:01 +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 C2948212FC for ; Wed, 25 Oct 2017 17:15:00 +0000 (UTC) Date: Wed, 25 Oct 2017 17:15:00 +0000 (UTC) From: "Marcelo Vanzin (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SPARK-21991) [LAUNCHER] LauncherServer acceptConnections thread sometime dies if machine has very high load MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 25 Oct 2017 17:15:06 -0000 [ https://issues.apache.org/jira/browse/SPARK-21991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marcelo Vanzin updated SPARK-21991: ----------------------------------- Fix Version/s: 2.0.3 > [LAUNCHER] LauncherServer acceptConnections thread sometime dies if machine has very high load > ---------------------------------------------------------------------------------------------- > > Key: SPARK-21991 > URL: https://issues.apache.org/jira/browse/SPARK-21991 > Project: Spark > Issue Type: Bug > Components: Spark Submit > Affects Versions: 2.0.2, 2.1.0, 2.1.1, 2.2.0 > Environment: Single node machine running Ubuntu 16.04.2 LTS (4.4.0-79-generic) > YARN 2.7.2 > Spark 2.0.2 > Reporter: Andrea Zito > Assignee: Andrea Zito > Priority: Minor > Fix For: 2.0.3, 2.1.3, 2.2.1, 2.3.0 > > > The way the _LauncherServer_ _acceptConnections_ thread schedules client timeouts causes (non-deterministically) the thread to die with the following exception if the machine is under very high load: > {noformat} > Exception in thread "LauncherServer-1" java.lang.IllegalStateException: Task already scheduled or cancelled > at java.util.Timer.sched(Timer.java:401) > at java.util.Timer.schedule(Timer.java:193) > at org.apache.spark.launcher.LauncherServer.acceptConnections(LauncherServer.java:249) > at org.apache.spark.launcher.LauncherServer.access$000(LauncherServer.java:80) > at org.apache.spark.launcher.LauncherServer$1.run(LauncherServer.java:143) > {noformat} > The issue is related to the ordering of actions that the _acceptConnections_ thread uses to handle a client connection: > # create timeout action > # create client thread > # start client thread > # schedule timeout action > Under normal conditions the scheduling of the timeout action happen before the client thread has a chance to start, however if the machine is under very high load the client thread can receive CPU time before the timeout action gets scheduled. > If this condition happen, the client thread cancel the timeout action (which is not yet been scheduled) and goes on, but as soon as the _acceptConnections_ thread gets the CPU back, it will try to schedule the timeout action (which has already been canceled) thus raising the exception. > Changing the order in which the client thread gets started and the timeout gets scheduled seems to be sufficient to fix this issue. > As stated above the issue is non-deterministic, I faced the issue multiple times on a single-node machine submitting a high number of short jobs sequentially, but I couldn't easily create a test reproducing the issue. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org