Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: avtikhon@tarantool.org, kyukhin@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH 3/3] feedback_daemon: speedup the first send to 2 minutes
Date: Wed, 21 Apr 2021 09:31:46 +0300	[thread overview]
Message-ID: <843fa23e74178b5eb1519e78cff36bad88b03587.1618986404.git.sergepetrenko@tarantool.org> (raw)
In-Reply-To: <cover.1618986404.git.sergepetrenko@tarantool.org>

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)


  parent reply	other threads:[~2021-04-21  6:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  6:31 [Tarantool-patches] [PATCH 0/3] replace feedback send on tarantool start with send after 2 minutes of operation Serge Petrenko via Tarantool-patches
2021-04-21  6:31 ` [Tarantool-patches] [PATCH 1/3] Revert "feedback_daemon: send feedback on server start" Serge Petrenko via Tarantool-patches
2021-04-21  6:31 ` [Tarantool-patches] [PATCH 2/3] feedback_daemon: do not trigger feedback send on first occurred event Serge Petrenko via Tarantool-patches
2021-04-21  6:31 ` Serge Petrenko via Tarantool-patches [this message]
2021-04-21 10:18 ` [Tarantool-patches] [PATCH 0/3] replace feedback send on tarantool start with send after 2 minutes of operation Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=843fa23e74178b5eb1519e78cff36bad88b03587.1618986404.git.sergepetrenko@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 3/3] feedback_daemon: speedup the first send to 2 minutes' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox