Details
Description
If invoking debug_sync_set_action(thd, ...) when thd->is_error() is true, it will return in error itself, even if the synchronization worked correctly. This is because of the following condition in its logic:
if (unlikely(thd->is_error()))
|
DBUG_RETURN(TRUE);
|
This means the established pattern of
DBUG_ASSERT(!debug_sync_set_action(thd,...))
|
will throw the DBUG_ASSERT when trying to synchronize threads during error handling.
It seems valid to synchronize in an error state, and debug_sync_set_action() should only return in error if it itself errors, and not if simply invoked in an already err'd out state.