Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abstract: make fibers cancellable #224

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion queue/abstract/driver/utubettl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ local function utubettl_fiber(self)
if box.info.ro == false then
local stat, err = pcall(utubettl_fiber_iteration, self, processed)

if not stat and not err.code == box.error.READONLY then
if not stat and not (err.code == box.error.READONLY) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to a separate commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

log.error("error catched: %s", tostring(err))
log.error("exiting fiber '%s'", fiber.name())
return 1
Expand Down
6 changes: 6 additions & 0 deletions queue/abstract/queue_state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ local function create_state_fiber(on_state_change_cb)
log.info('Queue state changed: WAITING')
end
end
-- Handle server shutdown.
if not pcall(fiber.testcancel) then
break
end
end
end)

log.info('Finished queue state fiber')
end

-- Public methods.
Expand Down
Loading