SiyaoIsHiding commented on code in PR #2037: URL: https://github.com/apache/cassandra-java-driver/pull/2037#discussion_r2067250917
########## core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java: ########## @@ -248,6 +259,16 @@ private void sendRequest( if (result.isDone()) { return; } + String nodeRequestId = this.distributedTraceIdGenerator.getNodeRequestId(statement, logPrefix); + if (!this.customPayloadKey.isEmpty()) { + // We cannot do statement.getCustomPayload().put() because the default empty map is abstract + // But this will create new Statement instance for every request. We might want to optimize + // this + Map<String, ByteBuffer> existingMap = new HashMap<>(statement.getCustomPayload()); Review Comment: This solves the concurrency problem, but it also means the subsequent `setFinalError(statement...)`, `NodeResponseCallback(statement,...)`, and RequestTracker invocations do not have the statement with the actual custom payload. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org