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 30451200C77 for ; Mon, 1 May 2017 19:12:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2EAEA160BAE; Mon, 1 May 2017 17:12:17 +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 4F14D160BA0 for ; Mon, 1 May 2017 19:12:16 +0200 (CEST) Received: (qmail 28769 invoked by uid 500); 1 May 2017 17:12:15 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 28757 invoked by uid 99); 1 May 2017 17:12:15 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 May 2017 17:12:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 93B98C047C for ; Mon, 1 May 2017 17:12:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id TP3SumElGe6Q for ; Mon, 1 May 2017 17:12:12 +0000 (UTC) Received: from mail-pg0-f53.google.com (mail-pg0-f53.google.com [74.125.83.53]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 601425F5F9 for ; Mon, 1 May 2017 17:12:11 +0000 (UTC) Received: by mail-pg0-f53.google.com with SMTP id o3so42248437pgn.2 for ; Mon, 01 May 2017 10:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Xp4prpZohh3mVwBOnf13oiS68TgPPUK4lBpv0JwIdWk=; b=ItwhzPi6UU5B7PFhpcMivTXWwAKiSK2biB96vyYE6WQ5cHAJ+sl7+nkAnX7HeBH0YE zAOzueKJ7luJgLn7aQvAmbFfTqZeMztyuhLkcZs2cEGBy8oKyTDhV+zfkhyZNjGeyy5p sgYVVbWECTLXczL5oPs04maS4dYNlcUE2gkcuaBtVanA9oIFznttDu+da+MYDmm0qmn5 JBk7c/3cgkVTY3BHHwnGEzCLMK3LaqTYKYrwR3/3Sky4O3PabbnTGaydvV8cglYN7dGB K+53of+ngExt+cuQjgJapVIEivYLMpEMFZnNi+S2lMxI7Tqw8rKDfJi/M7JfP/U1351i zWDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Xp4prpZohh3mVwBOnf13oiS68TgPPUK4lBpv0JwIdWk=; b=BPT2IUTqLphMSgFocmtL0uMR6ncA7TNCNW8GDpvQMA52HW+GFA0jnVXKehyKv1k/qw n+3TRvyB2LiUlE3OjBJCWBq80bqRYyFAr9FbQLhrJZsKo8Jstsp9KQDtf4CHh2fGFG2q Oe6+hJFjk8GM06k0JCVFGOUj95ttVwIApnVqfz5reroQuuyeQZn9BnEhmq54JzgkLD1K TVR2ZmNn4+OMgPyTIaxN4hpKyu+ryUqRMamcLWs45B1biAoVyFKTz1+c1DdY8QNefiCA zrffHum3TtDsealV0034csE/PTAc/g87FxUH+drzUs0XD2LO9yaISB45syHkkTxam36x dfUA== X-Gm-Message-State: AN3rC/5f0krGTja9Wd0a1IWjB3DL+KL2krIopYpMDqlwQcSC1Ttp5YPJ PoVyg4xdcxCnhGG2pUEIGNmZLG70wIXFe0A= X-Received: by 10.84.178.1 with SMTP id y1mr35919622plb.60.1493658723739; Mon, 01 May 2017 10:12:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.138.71 with HTTP; Mon, 1 May 2017 10:12:03 -0700 (PDT) In-Reply-To: References: From: Randall Hauch Date: Mon, 1 May 2017 10:12:03 -0700 Message-ID: Subject: Re: [DISCUSS] KIP-146: Classloading Isolation in Connect To: dev@kafka.apache.org Content-Type: multipart/alternative; boundary=94eb2c13ee8ca4ee3f054e7985f8 archived-at: Mon, 01 May 2017 17:12:17 -0000 --94eb2c13ee8ca4ee3f054e7985f8 Content-Type: text/plain; charset=UTF-8 Very nice work, Konstantine. Conflicting dependencies of connectors is indeed a big issue that makes it hard to manage installed connectors. I do like Gwen's idea about removing the 'module.isolation.enabled' property. However, I would have anticipated always using classpath isolation for *only* those components registered under the module path and not really for anything else already on the normal classpath. So, people could continue to place custom connector JARs onto the classpath, though this would become deprecated in favor of installing custom connector JARs / modules via the module path. This keeps configuration simple, gives people time to migrate, but let's people that need classpath isolation get it to install a variety of connectors each with their dependencies that potentially conflict with other components. The challenge is whether there should be a default for 'module.path'. Ideally there would be so that users know where they can install their connectors. However, I suspect that this might be difficult to do unless it can make use of system properties such as "${kafka.home}" so that relative directories can be specified. A few other questions/comments: 1) Does the KIP have to specify how are components / modules installed, discovered, or recognized by Kafka Connect? Or perhaps the KIP needs to just specify the semantics of the file system module path (e.g., the directories below those specified in the module path are to be unique and identify an installed component). 2) Will the module classloader filtering also have to exclude Kafka Connect dependencies? The only one that I can think of is the SLF4J API, which can't be loaded from the module's classloader if the connector is to send its log messages to the same logging system. 3) Rather than specify filtering, would be it a bit more flexible to simply say that the implementation will need to ensure that Java, Kafka Connect, and other third party APIs (e.g., SLF4J API) will not be loaded from the module classloaders? It'd be better to avoid specifying how it will be done, just in case the implementation needs to evolve or use a different technique (e.g., load the Java and public Kafka Connect APIs via one classloader that is reused and that always appears before the module classloader, while Kafka Connect implementation JARs appear after the component's classloader. 4) Perhaps to address #2 and #3 above, perhaps the KIP could explicitly specify the classloader order for a deployed connector. For example, 'java', 'kafka-connect-apis', 'connector-module', 'smt-module-1', ..., 'kafka-connect-impls', where 'connector-module' is the classloader for the (first) module where the connector is found, 'smt-module-1' is the classloader for the (first) module where the first SMT class is found (if specified and found in a separate module), 'smt-module-2' is the classloader .... Might also need to say that the KIP does not specify how the implementation will pick the module if a specified class if found in more than one module. Thoughts? Randall On Mon, May 1, 2017 at 6:43 AM, Gwen Shapira wrote: > Hi Konstantine, > > Thank you so much for driving this! The connector classpath mess is driving > me nuts (or worse, driving me to use Docker). > > I like the proposal for micro-benchmarks to test the context switching > overhead. > > I have a difficult time figuring out the module.isolation.enabled. > Especially with a default to false. I can't think of a reason that anyone > will not want classpath isolation. "No! I want my connectors to mess up > each other's dependencies" said no one ever. > > So it looks like this is mostly for upgrade purpose? Because the initial > upgrade will not have the module.path set and therefore classpath isolation > will simply not work by default? > > In that case, why don't we simply use the existence of non-empty > module.path as an indicator of whether isolation should work or not? seem > simpler and intuitive to me. > > Thanks! > > Gwen > > > > > > On Sat, Apr 29, 2017 at 9:16 AM, Konstantine Karantasis < > konstantine@confluent.io> wrote: > > > * Because of KIP number collision, please disregard my previous KIP > > announcement and use this thread for discussion instead * > > > > > > Hi everyone, > > > > we aim to address dependency conflicts in Kafka Connect soon by applying > > class loading isolation. > > > > Feel free to take a look at KIP-146 here: > > > > *https://cwiki.apache.org/confluence/display/KAFKA/KIP- > > 146+-+Classloading+Isolation+in+Connect > > > 146+-+Classloading+Isolation+in+Connect>* > > > > which describes minimal required changes to public interfaces and the > > general implementation approach. > > > > This is a much wanted feature for Kafka Connect. Your feedback is highly > > appreciated. > > > > -Konstantine > > > > > > -- > *Gwen Shapira* > Product Manager | Confluent > 650.450.2760 | @gwenshap > Follow us: Twitter | blog > > --94eb2c13ee8ca4ee3f054e7985f8--