Skip to content
Snippets Groups Projects
Commit 43b4342d authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

vinyl: fix worker crash at exit

To stop a vinyl worker on engine shutdown, we stop the event loop run by
the main worker fiber with cbus_stop_loop() and then join the thread
with cord_join(). Once the event loop is stopped, the main worker fiber
destroys the cbus endpoint and pipe to the tx thread and exits. However,
after it exits, a fiber executing a task may be scheduled. If this fiber
tries to send a message to tx thread, it will crash, because the pipe is
already destroyed:

  cbus.h:217: cpipe_push_input: Assertion `loop() == pipe->producer' failed.

Fix this issue by cancelling and joining the fiber executing a task, if
any, before destroying the pipe to tx.

Closes #3626
parent bdbe221a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment