Skip to content

Commit aa8f115

Browse files
denis-ignatenkoTotktonada
authored andcommitted
Always send zero as schema id at authentication
We cannot fetch a new schema before successful authentification, so it worth to always authentificate with zero schema id (to suppress server-side schema id check). Otwerwise we can receive SchemaReloadException and unable to do anything: neither authenticate, not fetch schema. Fixes #141.
1 parent bce4b88 commit aa8f115

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tarantool/request.py

+10
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ def sha1(values):
135135
IPROTO_TUPLE: ("chap-sha1", scramble)})
136136
self._body = request_body
137137

138+
def header(self, length):
139+
self._sync = self.conn.generate_sync()
140+
# Set IPROTO_SCHEMA_ID: 0 to avoid SchemaReloadException
141+
# It is ok to use 0 in auth every time.
142+
header = msgpack.dumps({IPROTO_CODE: self.request_type,
143+
IPROTO_SYNC: self._sync,
144+
IPROTO_SCHEMA_ID: 0})
145+
146+
return msgpack.dumps(length + len(header)) + header
147+
138148

139149
class RequestReplace(Request):
140150
'''

0 commit comments

Comments
 (0)