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 21BCB6EC5D; Fri, 2 Apr 2021 17:59:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 21BCB6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617375594; bh=ib9uefkWEXfQtucp/biaoMkZw2d09/0OlGVxjYioreE=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=IUtyxv8AXThtvgBEjiyJRr0WFekGJfokkCuerdkZZJGN0BqtmLxQfNzbpjNRFizEJ ri+9C3i1KMXBCopBtfPAPBqPTFi020k2exYxzKSSZ/nXnM3On9I/u/QmqFCPJXPNur SLpjfZ/oPYIpjwiPTkOqitumZjcgW6Q5GLDZ3l6k= Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 17EE66F3D8 for ; Fri, 2 Apr 2021 17:58:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 17EE66F3D8 Received: by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1lSLFe-0006jR-SI; Fri, 02 Apr 2021 17:58:23 +0300 To: v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org Date: Fri, 2 Apr 2021 17:58:02 +0300 Message-Id: <53f906760f240ea0f381fd693000139e8d5e5c8c.1617375300.git.sergepetrenko@tarantool.org> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E3294DD38BE31D7797EF84C856624A09E4809182A05F538085040C0C0E5D974CC743E7527ECF8C91F7ECA23AC96E7B7911EB8AAFA06293917FB6A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7444CB0504BAF4550EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378D64EDD178B2A1008638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7B5A45DDF210A4CF8ECE1484EC48454AC1255E0D0ABDBF42A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7A6779F98BF527B7A9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3776A0366D588B3C3117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFFD784DDD143CCC69BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6B5EB00832387078476E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CDDB9BF3B882869D543847C11F186F3C59DAA53EE0834AAEE X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46D2F727C0C66FF6115355D89D7DBCDD132 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C7B5A45DDF210A4CF8ECE1484EC48454AC1255E0D0ABDBF429C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348CDF4129B2EA85601C56ABD95D2972B8C6848F56B99614540B2654F3B477BAC945AA02CE4FF064B41D7E09C32AA3244C488F69A5C4C5753D2AE8F223B348C69081560E2432555DBB927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXhDmqlpxPgE91ENgPRJWvLv X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F81968ACF4E54473F805C9736B06963276286CA4C321A8DD1F424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH 3/4] feedback_daemon: send feedback on server start 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" Send the first report as soon as instance's initial configuration finishes. Closes #5750 --- src/box/lua/feedback_daemon.lua | 2 +- src/box/lua/load_cfg.lua | 34 ++++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/box/lua/feedback_daemon.lua b/src/box/lua/feedback_daemon.lua index d00eedf39..2ce768642 100644 --- a/src/box/lua/feedback_daemon.lua +++ b/src/box/lua/feedback_daemon.lua @@ -345,7 +345,7 @@ local function guard_loop(self) while true do if get_fiber_id(self.fiber) == 0 then - self.fiber = fiber.create(feedback_loop, self) + self.fiber = fiber.new(feedback_loop, self) log.verbose("%s restarted", PREFIX) end local st = pcall(fiber.sleep, self.interval) diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua index 44bb95ed1..885a0cac1 100644 --- a/src/box/lua/load_cfg.lua +++ b/src/box/lua/load_cfg.lua @@ -626,6 +626,27 @@ setmetatable(box, { end }) +-- A trigger on initial box.cfg{} call. Used to perform some checks and +-- send feedback report once instance is fully configured. +local function on_initial_config() + -- Check if schema version matches Tarantool version and print + -- warning if it's not (in case user forgot to call + -- box.schema.upgrade()). + local needs, schema_version_str = private.schema_needs_upgrade() + if needs then + local msg = string.format( + 'Your schema version is %s while Tarantool %s requires a more'.. + ' recent schema version. Please, consider using box.'.. + 'schema.upgrade().', schema_version_str, box.info.version) + log.warn(msg) + end + + -- Send feedback as soon as instance is configured. + if private.feedback_daemon ~= nil then + private.feedback_daemon.send() + end +end + -- Whether box is loaded. -- -- `false` when box is not configured or when the initialization @@ -716,17 +737,8 @@ local function load_cfg(cfg) box_is_configured = true - -- Check if schema version matches Tarantool version and print - -- warning if it's not (in case user forgot to call - -- box.schema.upgrade()). - local needs, schema_version_str = private.schema_needs_upgrade() - if needs then - local msg = string.format( - 'Your schema version is %s while Tarantool %s requires a more'.. - ' recent schema version. Please, consider using box.'.. - 'schema.upgrade().', schema_version_str, box.info.version) - log.warn(msg) - end + on_initial_config() + end box.cfg = locked(load_cfg) -- 2.24.3 (Apple Git-128)