absurdfarce commented on code in PR #2003:
URL: 
https://github.com/apache/cassandra-java-driver/pull/2003#discussion_r1939749387


##########
core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlPrepareAsyncProcessor.java:
##########
@@ -141,25 +195,23 @@ public CompletionStage<PreparedStatement> process(
       String sessionLogPrefix) {
 
     try {
-      CompletableFuture<PreparedStatement> result = 
cache.getIfPresent(request);
-      if (result == null) {
-        CompletableFuture<PreparedStatement> mine = new CompletableFuture<>();
-        result = cache.get(request, () -> mine);
-        if (result == mine) {
-          new CqlPrepareHandler(request, session, context, sessionLogPrefix)
-              .handle()
-              .whenComplete(
-                  (preparedStatement, error) -> {
-                    if (error != null) {
-                      mine.completeExceptionally(error);
-                      cache.invalidate(request); // Make sure failure isn't 
cached indefinitely
-                    } else {
-                      mine.complete(preparedStatement);
-                    }
-                  });
-        }
-      }
-      return result;
+      CompletableFuture<PreparedStatement> rv = new CompletableFuture<>();

Review Comment:
   Agree with both points.  This impl won't work as it stands... I'm wondering 
if there's anything that can be salvaged here or if this is just an outright 
dumpster fire and it's time to move on. 😞 



-- 
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]

Reply via email to