worryg0d commented on code in PR #1822:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1822#discussion_r1802849765
##########
conn.go:
##########
@@ -474,8 +483,12 @@ func (s *startupCoordinator) startup(ctx context.Context,
supported map[string][
case error:
return v
case *readyFrame:
+ // Connection is successfully set up and ready to use Native
Protocol v5
+ s.conn.startupCompleted = true
Review Comment:
As I see `Conn.startupCompleted` is being read by:
-
[Conn.serve](https://github.com/apache/cassandra-gocql-driver/blob/953e0df999cabb3f5eef714df9921c00e9f632c2/conn.go#L587)
which is run by
[Conn.init](https://github.com/apache/cassandra-gocql-driver/blob/953e0df999cabb3f5eef714df9921c00e9f632c2/conn.go#L306)
after `startup.setupConn` is finished.
[startupCoordinator.setupConn](https://github.com/apache/cassandra-gocql-driver/blob/953e0df999cabb3f5eef714df9921c00e9f632c2/conn.go#L372)
sends **STARTUP** as not framed envolope, receives **READY** or
**AUTHENTICATE** and sets `Conn.startupCompleted` to true.
`Conn.serve` is running in a separate go routine
-
[Conn.exec](https://github.com/apache/cassandra-gocql-driver/blob/953e0df999cabb3f5eef714df9921c00e9f632c2/conn.go#L1029)
which sends queries to C* and returns `framer` which contains C* response.
`Conn.exec` is also running in different go routines.
As I see there are no sync issues because `Conn.serve` is run after the
`startupCoordinator.startup` is completed, so it already reads messages from C*
by using proto v5. Even if during startup it receives **AUTHENTICATE** response
from C*, it will respond with **AUTH_RESPONSE** using proto v5.
--
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]