[Tarantool-patches] [PATCH 3/3] feedback_daemon: speedup the first send to 2 minutes

Serge Petrenko sergepetrenko at tarantool.org
Wed Apr 21 09:31:46 MSK 2021


The first send should happen sooner, than default feedback interval, to
catch not so long-living instances. This replaces the commit we had with
sending feedback right from initial box.cfg{} and on first event
appearance, such as creation/drop of a space or index.

The reason for this commit instead of "send feedback on server start",
is that the latter one was quite hacky and didn't work correctly without
some ugly crutches, namely, fiber.sleep(10) in feedback daemon code.

Follow-up #5750
---
 src/box/lua/feedback_daemon.lua | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/box/lua/feedback_daemon.lua b/src/box/lua/feedback_daemon.lua
index 239af5fda..e1263866a 100644
--- a/src/box/lua/feedback_daemon.lua
+++ b/src/box/lua/feedback_daemon.lua
@@ -330,9 +330,12 @@ end
 
 local function feedback_loop(self)
     fiber.name(PREFIX, { truncate = true })
+    -- Speed up the first send.
+    local send_timeout = math.min(120, self.interval)
 
     while true do
-        local msg = self.control:get(self.interval)
+        local msg = self.control:get(send_timeout)
+        send_timeout = self.interval
         -- if msg == "send" then we simply send feedback
         if msg == "stop" then
             break
-- 
2.24.3 (Apple Git-128)



More information about the Tarantool-patches mailing list