vaticle / typedb-driver-python

TypeDB Driver for Python
https://typedb.com
Apache License 2.0
67 stars 25 forks source link

Cluster server client: stub creation depends on stub #273

Closed dmitrii-ubskii closed 1 year ago

dmitrii-ubskii commented 1 year ago

Description

Potential circular dependency in https://github.com/vaticle/typedb-client-python/blob/master/typedb/connection/cluster/server_client.py.

The constructor of _ClusterServerClient calls _ClusterServerClient.new_channel_and_stub() during creation of the channel and the gRPC _stub of a server client (L36), which calls _ClusterServerClient._new_channel() (L49), which references a yet-not-created self._stub in a lambda that it passes to grpc.metadata_call_credentials() (L60), which, if it calls the lambda at that point, correctly raises AttributeError: '_ClusterServerClient' object has no attribute '_stub'.

alexjpwalker commented 1 year ago

Hopefully this issue will dissolve when we call Rust via FFI.