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 2DB8F6EC5F; Mon, 19 Apr 2021 20:54:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2DB8F6EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618854851; bh=buvAT3NYfQNd1X35T9vvOdMj+VtotxL1CJfo2wEFnE8=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Twsll1R1MeVHQSp3gjxfpqMKWxtyb9HhGWy9Ywot9QFPwyNwtwrs13YFtq/CRHrvz Tp0khTCrqAj2D63N7J/OMpEokUmTzna02epQ0Fm5qOuhhjfqDkb+PNlXktteTfD1af B8t4DCx5gENgamW7EsdAGAlo8cXg7O5MjTTGaAE4= Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D69896EC5F for ; Mon, 19 Apr 2021 20:54:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D69896EC5F Received: by smtp38.i.mail.ru with esmtpa (envelope-from ) id 1lYY64-0007Le-RL; Mon, 19 Apr 2021 20:54:09 +0300 To: avtikhon@tarantool.org, v.shpilevoy@tarantool.org Date: Mon, 19 Apr 2021 20:53:57 +0300 Message-Id: <20210419175357.13479-1-sergepetrenko@tarantool.org> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480257C85EA0BB7A95D0F00AE41BB9A5343182A05F5380850408BE80EE0043E0561B7073A620E670C553980048DAFAE31A011589DF7DB2A0E68 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DB84ED444C624799EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C8DFB935205A313D8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B20F78F3F9D8C10EEADFB773099E6E4BFE0F54D0ACED2DBEF802ED4CEA229C1FA827C277FBC8AE2E8B59F0E22272DBA2DBA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7BEE62E5629C982429FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3ECBEDCEC3CCF9A28117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B569F1129A2C6445075ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C5C2F678D3BD5F5298A5753C90D982BE6BA2458CB7ECC84059C2B6934AE262D3EE7EAB7254005DCEDDD01B8980DE9A8611E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0279E343DB675BB2F8E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34951738D4D62E58A486067B9B28F043A4DBAE7570E58DE61CB7B655B899772BEF71A035A6FE1C03F21D7E09C32AA3244C30EB2AFE750AEB35209B1D529937D3B124AF4FAF06DA24FD927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXgwiRyyOpt1+Uece78svK0Y X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A4461686CA75CF6E7406985582070382ED6BE054621235E2F77C424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH] feedback_daemon: fix indexing a nil value issue 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: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" When running tarantool with disabled feedback daemon the following error appeared on each space/index create/drop: builtin/box/feedback_daemon.lua:380: attempt to index field 'cached_events' (a nil value) This happened because 'cached_events' table is initialized only on feedback daemon start. Fix the issue by checking for type of `cached_events` and only indexing it when it's a table. Follow-up #5750 --- branch: https://github.com/tarantool/tarantool/tree/sp/feedback-daemon-fix src/box/lua/feedback_daemon.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/box/lua/feedback_daemon.lua b/src/box/lua/feedback_daemon.lua index 7a6b0c94c..ee0315c2d 100644 --- a/src/box/lua/feedback_daemon.lua +++ b/src/box/lua/feedback_daemon.lua @@ -377,6 +377,10 @@ local function save_event(self, event) if type(event) ~= 'string' then error("Usage: box.internal.feedback_daemon.save_event(string)") end + if type(self.cached_events) ~= 'table' then + return + end + self.cached_events[event] = (self.cached_events[event] or 0) + 1 if self.cached_events[event] == 1 then -- The first occurred event of this type triggers report dispatch -- 2.24.3 (Apple Git-128)