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


##########
core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilder.java:
##########
@@ -119,6 +129,8 @@ public Map<String, String> build() {
     if (applicationVersion != null) {
       builder.put(APPLICATION_VERSION_KEY, applicationVersion);
     }
+    // do not cache local DC as it can change within LBP implementation

Review Comment:
   Maybe I'm missing something but... isn't this _exactly_ what we're doing 
here?  We're in the middle of StartupOptionsBuilder.build() which is only 
called when DefaultDriverContext is building a new StartupOptions instance... 
and it only does that once (lazily, the first time it's needed).  So if 
information becomes available later... how is it ever updated here?
   
   Bad thing is the creation of Startup instances [only 
takes](https://github.com/apache/cassandra-java-driver/blob/4.19.0/core/src/main/java/com/datastax/oss/driver/internal/core/channel/ProtocolInitHandler.java#L178)
 whatever the context gives you for startup options... so there isn't a whole 
lot of room to work with here.  You could probably fix this by making 
DefaultDriverContext.getStartupOptions() do something beyond just returning the 
static list of startup options... maybe you could query the LBPs there and 
update any information (if updates are to be had).



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