Skip to content

Commit ad3f636

Browse files
committed
core: make queue_state_fiber cancellable
We are going to finish all client (non-system) fibers in the process of Tarantool shutdown. First we cancel them and then wait for their finishing. So if the client fibers are not finished Tarantool shutdown is never finished too. Currently the fiber can not be finished and we got hang in integration testing of PR tarantool/tarantool#9604.
1 parent e99ce45 commit ad3f636

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: queue/abstract/queue_state.lua

+4
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ local function create_state_fiber(on_state_change_cb)
8585
log.info('Queue state changed: WAITING')
8686
end
8787
end
88+
-- Handle server shutdown.
89+
if not pcall(fiber.testcancel) then break end
8890
end
8991
end)
92+
93+
log.info('Finished queue state fiber')
9094
end
9195

9296
-- Public methods.

0 commit comments

Comments
 (0)