diff --git a/fdbrpc/FlowTransport.actor.cpp b/fdbrpc/FlowTransport.actor.cpp index 25c0e7f85d..732c3fe9f6 100644 --- a/fdbrpc/FlowTransport.actor.cpp +++ b/fdbrpc/FlowTransport.actor.cpp @@ -171,7 +171,7 @@ TaskPriority EndpointMap::getPriority(Endpoint::Token const& token) { // we don't allow this priority to be "misused" for other stuff as we won't even // attempt to find an endpoint if UnknownEndpoint is returned here ASSERT(res != TaskPriority::UnknownEndpoint); - return static_cast(data[index].token().second()); + return res; } return TaskPriority::UnknownEndpoint; } @@ -1070,7 +1070,9 @@ static void scanPackets(TransportData* transport, // we ignore packets to unknown endpoints if they're not going to a stream anyways, so we can just // return here. The main place where this seems to happen is if a ReplyPromise is not waited on // long enough. - // It would be slightly more elegant to put this if-block + // It would be slightly more elegant/readable to put this if-block into the deliver actor, but if + // we have many messages to UnknownEndpoint we want to optimize earlier. As deliver is an actor it + // will allocate some state on the heap and this prevents it from doing that. if (priority != TaskPriority::UnknownEndpoint || (token.first() & TOKEN_STREAM_FLAG) == 0) { deliver(transport, Endpoint({ peerAddress }, token), priority, std::move(reader), true); }