MXS-1506: Always queue the delayed routing task

The worker task should never be immediately executed to allow the task to
be executed on the next "tick" of the worker. This prevents recursive
calls to e.g. routeQuery in readwritesplit when errors are handled.
This commit is contained in:
Markus Mäkelä
2018-04-11 11:28:31 +03:00
parent 553e159182
commit 3aa62b0116

View File

@ -1400,8 +1400,13 @@ bool session_delay_routing(MXS_SESSION* session, MXS_DOWNSTREAM down, GWBUF* buf
if (seconds == 0)
{
// No actual delay, just re-route query
worker->post(task);
/**
* No actual delay, just re-route query. The worker task should
* never be immediately executed. They must be executed on the next
* "tick" of the worker to prevent recursive calls to
* e.g. routeQuery in readwritesplit when errors are handled.
*/
worker->post(task, Worker::EXECUTE_QUEUED);
}
else
{