diff --git a/src/protocols/protocol_filter_out_70015.cpp b/src/protocols/protocol_filter_out_70015.cpp index 06348d85..1a9115e5 100644 --- a/src/protocols/protocol_filter_out_70015.cpp +++ b/src/protocols/protocol_filter_out_70015.cpp @@ -220,8 +220,11 @@ bool protocol_filter_out_70015::handle_receive_get_filters(const code& ec, return false; } + // Post send and desubscribe. Posting prevents a synchronous completion + // (an empty ancestry) from resubscribing re-entrantly within the channel + // subscriber notification. span(events::ancestry_msecs, start); - send_filter(error::success, ancestry); + POST(send_filter, error::success, ancestry); return false; } diff --git a/src/protocols/protocol_transaction_out_106.cpp b/src/protocols/protocol_transaction_out_106.cpp index a208307f..0ebcbf3f 100644 --- a/src/protocols/protocol_transaction_out_106.cpp +++ b/src/protocols/protocol_transaction_out_106.cpp @@ -150,8 +150,10 @@ bool protocol_transaction_out_106::handle_receive_get_data(const code& ec, if (stopped(ec)) return false; - // Send and desubscribe. - send_transaction(error::success, zero, message); + // Post send and desubscribe. Posting prevents a synchronous completion + // (a get_data with no transaction items) from resubscribing re-entrantly + // within the channel subscriber notification. + POST(send_transaction, error::success, zero, message); return false; } @@ -175,7 +177,6 @@ void protocol_transaction_out_106::send_transaction(const code& ec, if (message->items.at(index).is_transaction_type()) break; - // BUGBUG: registration race. if (index >= message->items.size()) { // Complete, resubscribe to transaction requests.