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 3A46D200BC8 for ; Wed, 23 Nov 2016 23:02:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 35913160B0A; Wed, 23 Nov 2016 22:02:00 +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 7A85C160AEC for ; Wed, 23 Nov 2016 23:01:59 +0100 (CET) Received: (qmail 71062 invoked by uid 500); 23 Nov 2016 22:01:58 -0000 Mailing-List: contact issues-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list issues@mesos.apache.org Received: (qmail 71035 invoked by uid 99); 23 Nov 2016 22:01:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2016 22:01:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7C7C32C03E5 for ; Wed, 23 Nov 2016 22:01:58 +0000 (UTC) Date: Wed, 23 Nov 2016 22:01:58 +0000 (UTC) From: "Joseph Wu (JIRA)" To: issues@mesos.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MESOS-4609) Subprocess should be more intelligent about setting/inheriting libprocess environment variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 23 Nov 2016 22:02:00 -0000 [ https://issues.apache.org/jira/browse/MESOS-4609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15691474#comment-15691474 ] Joseph Wu commented on MESOS-4609: ---------------------------------- Committed the refactoring parts of this ticket: {code} commit d022300acc907bfe507a7cb8f1c5767a2bd6d7bb Author: Armand Grillet Date: Wed Nov 23 13:21:31 2016 -0800 Added net::IP parsing template to the flags parsers. This will allow us to specify the `net::IP` type as a field inside flags. Review: https://reviews.apache.org/r/53558/ {code} {code} commit 1d33559fad35a4ca84f275b1c1544aa5afa48e28 Author: Armand Grillet Date: Wed Nov 23 13:21:32 2016 -0800 Transformed env variable parsing into Flags in libprocess. This retains existing environment variables read by libprocess (LIBPROCESS + IP, ADVERTISE_IP, PORT, ADVERTISE_PORT) but parsing is done via a Flags object. This also documents the behavior and expectations of the flags, and prints a more helpful error message if the environment variables are set incorrectly. Review: https://reviews.apache.org/r/53559/ {code} > Subprocess should be more intelligent about setting/inheriting libprocess environment variables > ------------------------------------------------------------------------------------------------ > > Key: MESOS-4609 > URL: https://issues.apache.org/jira/browse/MESOS-4609 > Project: Mesos > Issue Type: Bug > Components: libprocess > Affects Versions: 0.27.0 > Reporter: Joseph Wu > Labels: mesosphere > > Mostly copied from [this comment|https://issues.apache.org/jira/browse/MESOS-4598?focusedCommentId=15133497&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15133497] > A subprocess inheriting the environment variables {{LIBPROCESS_*}} may run into some accidental fatalities: > | || Subprocess uses libprocess || Subprocess is something else || > || Subprocess sets/inherits the same {{PORT}} by accident | Bind failure -> exit | Nothing happens (?) | > || Subprocess sets a different {{PORT}} on purpose | Bind success (?) | Nothing happens (?) | > (?) = means this is usually the case, but not 100%. > A complete fix would look something like: > * If the {{subprocess}} call gets {{environment = None()}}, we should automatically remove {{LIBPROCESS_PORT}} from the inherited environment. > * The parts of [{{executorEnvironment}}|https://github.com/apache/mesos/blame/master/src/slave/containerizer/containerizer.cpp#L265] dealing with libprocess & libmesos should be refactored into libprocess as a helper. We would use this helper for the Containerizer, Fetcher, and ContainerLogger module. > * If the {{subprocess}} call is given {{LIBPROCESS_PORT == os::getenv("LIBPROCESS_PORT")}}, we can LOG(WARN) and unset the env var locally. -- This message was sent by Atlassian JIRA (v6.3.4#6332)