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
Loading
Please register or sign in to comment