summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_misc.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index a508794c4c..a5fef7c3ae 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -419,7 +419,10 @@ execute_mnesia_transaction(TxFun) ->
%% elsewhere and get a consistent result even when that read
%% executes on a different node.
case worker_pool:submit({mnesia, sync_transaction, [TxFun]}) of
- {atomic, Result} -> mnesia_sync:sync(),
+ {atomic, Result} -> case mnesia:is_transaction() of
+ true -> ok;
+ false -> mnesia_sync:sync()
+ end,
Result;
{aborted, Reason} -> throw({error, Reason})
end.