From e437c5a12b10d63acf13ddfa4fd4981d785c525d Mon Sep 17 00:00:00 2001 From: Ilya Grishnov Date: Wed, 18 Jan 2023 12:15:58 +0300 Subject: [PATCH] bugfix: fixed a bug of the fiber status call Fixed a bug of the fiber status call when processing `RELOAD_SCHEMA_TIMEOUT` in `call_reload_schema`. Before that, an error occurred in this case with description: `calling 'status' on bad self (fiber expected, got table)`. To reproduce the error before this fix, it is enough to checkout to the one commit back and perform the action described in #331. Now the fibers for schema reloading are correctly canceled if the timeout on schema reloading is reached. --- CHANGELOG.md | 6 ++++++ crud/common/schema.lua | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07939d7e..6837218b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed ### Fixed +* Fixed a bug of the fiber status call when + processing `RELOAD_SCHEMA_TIMEOUT` in `call_reload_schema`. + Before that, an error occurred in this case with description: + `calling 'status' on bad self (fiber expected, got table)`. + Now the fibers for schema reloading are correctly canceled + if the timeout on schema reloading is reached. ## [0.14.1] - 10-11-22 diff --git a/crud/common/schema.lua b/crud/common/schema.lua index ab86df07..1cbc01f1 100644 --- a/crud/common/schema.lua +++ b/crud/common/schema.lua @@ -37,7 +37,7 @@ local function call_reload_schema(replicasets) for _ = 1,replicasets_num do if channel:get(const.RELOAD_SCHEMA_TIMEOUT) == nil then for _, f in ipairs(fibers) do - if fiber:status() ~= 'dead' then + if f:status() ~= 'dead' then f:cancel() end end