From hdfs-issues-return-249949-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Fri Feb 1 13:12:05 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9A8C3180627 for ; Fri, 1 Feb 2019 14:12:04 +0100 (CET) Received: (qmail 52988 invoked by uid 500); 1 Feb 2019 13:12:03 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 52977 invoked by uid 99); 1 Feb 2019 13:12:03 -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; Fri, 01 Feb 2019 13:12:03 +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 478E51821FF for ; Fri, 1 Feb 2019 13:12:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, 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 gG-Ex0y3vBs4 for ; Fri, 1 Feb 2019 13:12:01 +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 54C6960EB7 for ; Fri, 1 Feb 2019 13:12:01 +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 8C15CE0147 for ; Fri, 1 Feb 2019 13:12:00 +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 41BBA243CC for ; Fri, 1 Feb 2019 13:12:00 +0000 (UTC) Date: Fri, 1 Feb 2019 13:12:00 +0000 (UTC) From: "Kevin Risden (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-14251) BlockPoolSlice ForkJoinPool introduced by HDFS-13768 breaks under Java SecurityManager MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-14251?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1675= 8281#comment-16758281 ]=20 Kevin Risden commented on HDFS-14251: ------------------------------------- JDK9+ changed the behavior of ForkJoinPool so that threads by default get n= o permissions under the Java SecurityManager with the default thread factor= y. This wasn't the case in JDK8.=C2=A0 [https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPoo= l.html] {code:java} If a=C2=A0SecurityManager=C2=A0is present and no factory is specified, then= the default pool uses a factory supplying threads that have no=C2=A0Permis= sions=C2=A0enabled. The system class loader is used to load these classes. = Upon any error in establishing these settings, default parameters are used.= It is possible to disable or limit the use of threads in the common pool b= y setting the parallelism property to zero, and/or using a factory that may= return=C2=A0null. However doing so may cause unjoined tasks to never be ex= ecuted. {code} [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/con= current/ForkJoinPool.html] {code:java} If no thread factory is supplied via a system property, then the common poo= l uses a factory that uses the system class loader as the=C2=A0thread conte= xt class loader. In addition, if a=C2=A0SecurityManager=C2=A0is present, th= en the common pool uses a factory supplying threads that have no=C2=A0Permi= ssions=C2=A0enabled. Upon any error in establishing these settings, default= parameters are used. It is possible to disable or limit the use of threads= in the common pool by setting the parallelism property to zero, and/or usi= ng a factory that may return=C2=A0null. However doing so may cause unjoined= tasks to never be executed.{code} From=C2=A0[https://github.com/apache/hadoop/blob/branch-3.2/hadoop-hdfs-pro= ject/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdat= aset/impl/BlockPoolSlice.java#L213] =C2=A0 Based on discussion in SOLR-9515, doing any IO within the ForkJoinPool can = cause issues and should most likely not be used for this purpose. If the Fo= rkJoinPool must be used, then a way to set the custom thread factory would = be useful so the security policy can be passed in. > BlockPoolSlice ForkJoinPool introduced by HDFS-13768 breaks under Java S= ecurityManager > -------------------------------------------------------------------------= -------------- > > Key: HDFS-14251 > URL: https://issues.apache.org/jira/browse/HDFS-14251 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.10.0, 3.2.0, 3.1.2 > Reporter: Kevin Risden > Priority: Major > > HDFS-13768 introduced ForkJoinPool to improve performance of=C2=A0BlockPo= olSlice. The created ForkJoinPool doesn't pass in a custom thread factory a= nd by default the thread factory prevents all privileges under the Java Sec= urityManager. > This broke when integrating Hadoop 3.2.0 with Apache Solr in=C2=A0SOLR-95= 15. > It isn't clear that the ForkJoinPool is necessary when a regular normal e= xecutor could work instead? -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org