From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6875D2AFB1 for ; Sun, 14 Apr 2019 18:42:03 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YflIoBDUTkB6 for ; Sun, 14 Apr 2019 18:42:03 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id B58642A2F0 for ; Sun, 14 Apr 2019 18:42:02 -0400 (EDT) Date: Mon, 15 Apr 2019 01:41:52 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH] tarantoolctl: remove metatable assumptions in start() Message-ID: <20190414224150.gcv2hbmazhri7o5w@tkn_work_nb> References: <20190327134014.56676-1-roman.habibov@tarantool.org> <20190401054304.kofvdg3uz6fzwl5d@tkn_work_nb> <20190411145725.il4veadyw4lcktj2@tkn_work_nb> <80D84297-4781-41C1-9E70-14712A77BA40@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <80D84297-4781-41C1-9E70-14712A77BA40@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Roman Khabibov Cc: tarantool-patches@freelists.org The code is okay, but I would clarify the commit message a bit. > >> > >> There was assumpted uninitialized metamethods of box.cfg{} if user > >> did't call it in his instance. > > > > This sentence raises more questions then give answers. What is > > 'uninitialized metamethods'? Whether 'of box.cfg{}' means result of the > > call or a new value of the 'cfg' field of the 'box' table? > > > > Also I doubt 'There was assumpted' is valid phrase. > > tarantoolctl: raise error when box.cfg isn't called > > There was no check whether box.cfg{} was initialized in an > instance. If so, an error should be raised. 'box' can be initialized (it is a module), 'box.cfg' can be called, but we usually use parentheses to mark a name as a function, so 'box.cfg()' can be called. Technically 'box.cfg{} was initialized' is not correct. 'If so' here point to the positive case (when called). Let me propose wording that will satisfy me: > Added a check whether box.cfg() is called within an instance file. If > box.cfg() is missed, point a user the reason of a fail explicitly. > > Before this commit the error was look so: > > /usr/bin/tarantoolctl:541: attempt to index a nil value Also don't forget to add 'Fixes #xxxx' clause to the end of the commit message.