From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 8CBFA6EC5D; Mon, 5 Apr 2021 14:26:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8CBFA6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617621999; bh=i83scDnDZzl12ZqXSot3VVBv7T9TGugtaRhqobgMSzc=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=wAKcxv2CI732n6sb1tbSfoa+lIQZmGX1ASmd0xJiDM8lZJYcEKRjLaCMAH4kkPSIz AJ19Hn5xILkv1H+PgQ4hfK+XBu+m6yB9y6skI2ih5wJgF291QFk+NRj1RlzYVwxGwQ oGwS8sanByXAyI+ThF4vH71qBYayS9VlNNx5sskk= Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id AFC7A6EC5D for ; Mon, 5 Apr 2021 14:26:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AFC7A6EC5D Received: by mail-lf1-f44.google.com with SMTP id o10so16891738lfb.9 for ; Mon, 05 Apr 2021 04:26:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=hO0wVMGbq12t8/kPR7BQp5Ejp6bUh/t6yf96F7FoZvU=; b=CiTqnuLR0ZEMfnNi5IeYRTkhbZDxcGK7/lUF0rK9tNwBqBOfODW1YJD89WdTOmtc9K AMhqO3iOzT4w+CZm0dQ3wU5GGbv2imD6W2ywGTPZS3NFLyBNbxuDXee0Mhs1uhJxBjDB BFCBPQ3cUV3pAhTwJMEZVzYhtw/VlDV0M6owHDrjkPxU6JEZYDJzhdcHk8LWVOdBJM1V geoHrgBImbUrezCfwn+QToRzqDmHFtSJoHj1XU709IjWHdh8IagEdq4zaAEiw5bEu7fk DNojiSMqToPM7zCo8HlidN1vL90QdoHH7ZfZQ/TGBt/XuMM+n5cPdek/9jYHprH4769m pDaQ== X-Gm-Message-State: AOAM533nNn1pzt7FuCt4V8Q2oQ530SXTveU4JvFrQYhmSWaCBrPeJT0M 7Pgd5QaNesqmiTsZXrDdpMl1NhqkEHU= X-Google-Smtp-Source: ABdhPJxtzx/TwvQh2Mh7I7Yt0YdWy50bqayXLq3AlfKyJwv5MBbyJX7cvjTPISHWH7bv0EYnnEs8Dg== X-Received: by 2002:a05:6512:338a:: with SMTP id h10mr17986968lfg.277.1617621996490; Mon, 05 Apr 2021 04:26:36 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id q16sm1750348lfm.35.2021.04.05.04.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Apr 2021 04:26:34 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 575D05601CD; Mon, 5 Apr 2021 14:26:33 +0300 (MSK) Date: Mon, 5 Apr 2021 14:26:33 +0300 To: Serge Petrenko Message-ID: References: <20210402123420.885834-1-gorcunov@gmail.com> <20210402123420.885834-4-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.0.5 (2021-01-21) Subject: Re: [Tarantool-patches] [PATCH v20 3/7] box/func: fix modules functions restore X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: tml , Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" > > 02.04.2021 15:34, Cyrill Gorcunov пишет: > > In commit 96938fafb an ability to hot reload of modules > > has been introduced. When module is been reloaded his > > typo: either 'is being reloaded' or 'has been reloaded'. Thanks! Surely it should be "is being". > > - * Some old-dso func can't be load from new module, restore old > > - * functions. > > + * Some old functions are not found int the new module, > > + * thus restore all migrated functions back to original. > > typo: in the new module. Thanks! > > @@ -419,9 +420,7 @@ module_reload(const char *package, const char *package_end) > > } > > func->module = old_module; > > rlist_move(&old_module->funcs, &func->item); > > - } while (func != rlist_first_entry(&old_module->funcs, > > - struct func_c, item)); > > - assert(rlist_empty(&new_module->funcs)); > > Let's keep this assert. The cycle is removing entries from the list and for this purpose the cycle is using a "safe" form. I would prefer to drop this useless assert() because a few lines above we are doing entries removing. Frankly I don't understand why it has been introduced in first place, maybe because this stange and buggy form of "func != rlist_first_entry", dunno. So if there is no really strong reason why should we keep this assert I would love to drop it. Look, here is what we have list_for_each_entry_safe(item, head, ...) list_move(item, new_head) a few obvious lines. And list is clear once the @item reaches @head. But if you still think it is better to keep and I didn't convince you, then sure, I'll bring it back.