Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] feedback_daemon: fix indexing a nil value issue
@ 2021-04-19 17:53 Serge Petrenko via Tarantool-patches
  2021-04-19 22:39 ` Vladislav Shpilevoy via Tarantool-patches
  0 siblings, 1 reply; 4+ messages in thread
From: Serge Petrenko via Tarantool-patches @ 2021-04-19 17:53 UTC (permalink / raw)
  To: avtikhon, v.shpilevoy; +Cc: 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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-20 19:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 17:53 [Tarantool-patches] [PATCH] feedback_daemon: fix indexing a nil value issue Serge Petrenko via Tarantool-patches
2021-04-19 22:39 ` Vladislav Shpilevoy via Tarantool-patches
2021-04-20  9:28   ` Serge Petrenko via Tarantool-patches
2021-04-20 19:42     ` Vladislav Shpilevoy via Tarantool-patches

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