File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,6 +189,9 @@ def connect(self, *args):
189189
190190 self ._nodes .append (conn )
191191
192+ if self .protocol_version is None :
193+ raise ReconnectError ('Can not connect.' )
194+
192195 def close (self ):
193196 for conn in self ._nodes :
194197 conn .close ()
Original file line number Diff line number Diff line change @@ -242,13 +242,15 @@ def connect(
242242 :param host: GridGain server node's host name or IP,
243243 :param port: GridGain server node's port number.
244244 """
245+ detecting_protocol = False
245246
246247 # go non-blocking for faster reconnect
247248 if not self ._in_use .acquire (blocking = False ):
248249 raise ConnectionError ('Connection is in use.' )
249250
250251 # choose highest version first
251252 if self .client .protocol_version is None :
253+ detecting_protocol = True
252254 self .client .protocol_version = max (PROTOCOLS )
253255
254256 try :
@@ -259,6 +261,11 @@ def connect(
259261 result = self ._connect_version (host , port )
260262 else :
261263 raise e
264+ except connection_errors :
265+ # restore undefined protocol version
266+ if detecting_protocol :
267+ self .client .protocol_version = None
268+ raise
262269
263270 # connection is ready for end user
264271 self .uuid = result .get ('node_uuid' , None ) # version-specific (1.4+)
You can’t perform that action at this time.
0 commit comments