Skip to content

Commit

Permalink
bugfix: fixed a bug of the fiber status call
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GRISHNOV committed Jan 19, 2023
1 parent 8b2c585 commit e437c5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion crud/common/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e437c5a

Please sign in to comment.