frankgh commented on code in PR #4936:
URL: https://github.com/apache/cassandra/pull/4936#discussion_r3590987223
##########
src/java/org/apache/cassandra/transport/Dispatcher.java:
##########
@@ -480,11 +474,19 @@ static Message.Response processRequest(Channel channel,
Message.Request request,
void processRequest(Channel channel, Message.Request request,
FlushItemConverter forFlusher, Overload backpressure, RequestTime requestTime)
{
Message.Response response = processRequest(channel, request,
backpressure, requestTime);
- FlushItem<?> toFlush = forFlusher.toFlushItem(channel, request,
response);
+ FlushItem<?> toFlush = forFlusher.toFlushItem(channel, request,
decorateResponse(response, request));
Message.logger.trace("Responding: {}, v={}", response,
request.connection().getVersion());
flush(toFlush);
}
+ private static Message.Response decorateResponse(Message.Response
response, Message.Request request)
+ {
+ assert response != null;
+ response.setStreamId(request.getStreamId());
Review Comment:
This method is not the only sink for responses, and that's why we still need
to set it in the callers to `ErrorMessage` . For example, the callsites for
[ExceptionHandlers:81](https://github.com/apache/cassandra/pull/4936/changes#diff-e1b0892fa35b7a7e1fbbc8fd9418c9156ab0bd6837acf4279feddb54510b497dR81),
[PreV5Handlers:342](https://github.com/apache/cassandra/pull/4936/changes#diff-bd4e9e38614c46ae498bef5d2a344766cd14f21e0272961a9e26fe549b6af061R342),
[InitialConnectionHandler:134](https://github.com/apache/cassandra/pull/4936/changes#diff-594abfb9cdc04f8056be7cee47e023b1b4702c9d4e4875ff76cedbf38faf4a29L134)
/
[163](https://github.com/apache/cassandra/pull/4936/changes#diff-594abfb9cdc04f8056be7cee47e023b1b4702c9d4e4875ff76cedbf38faf4a29R163),
and
[Dispatcher:115](https://github.com/apache/cassandra/pull/4936/changes#diff-848b0127eef4d9764bc9a135dd5fd4007ad625aa339e0f9ee51d73648181507fR115)
do not flow through `processRequest` in the Dispatcher, and the stream ID
would not be set.
I'd prefer to have the redundancy here since it is a harmless operation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]