You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the client polling /v1/.well-known/openid-configuration to determine the OIDC config, the now-default 90s timeout for insert operations seem to dictate the timeout period for the client.
It may be preferable to set a separate parameter, or use the init value.
Script to reproduce (vary the insert parameter):
importsocketimporttimeimportthreadingimportweaviatefromweaviate.classes.initimportTimeout, AdditionalConfigimporttimedefserver_thread(stop_event):
# Create a TCP/IP socketserver_socket=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address= ('localhost', 12345)
server_socket.bind(server_address)
server_socket.listen(1)
# print('Server listening on {}:{}'.format(*server_address))whilenotstop_event.is_set():
# print('Waiting for a connection...')try:
connection, client_address=server_socket.accept()
exceptOSError:
# Handle potential socket error when shutting downbreaktry:
# print('Connection from', client_address)# Receive data and simulate a delaydata=connection.recv(1024)
# print('Received:', data)time.sleep(100) # Simulate 100 second black hole# Do not send a responsefinally:
connection.close()
server_socket.close()
# print('Server stopped')returnTruedefrun_weaviate():
for (port, grpc_port, timeout) in [
(8080, 50051, 2), # Correct
(12345, 50051, 2), # REST Black hole
(8080, 12345, 2), # gRPC Black hole
(1111, 50051, 2), # Incorrect REST
(8080, 1111, 2), # Incorrect gRPC
]:
print(f"\n")
print(f"="*80)
print(f"port={port}, grpc_port={grpc_port}, timeout={timeout}")
print(f"="*80)
print(f"\n")
starttime=time.time()
try:
client=weaviate.connect_to_local(
port=port,
grpc_port=grpc_port,
additional_config=AdditionalConfig(
timeout=Timeout(init=timeout, insert=5) # Set grpc timeout to 2 seconds, rest timeout to 5 seconds
)
)
assertclient.is_ready()
print("Weaviate is ready")
client.close()
exceptExceptionase:
print(e)
print("Time taken: ", time.time() -starttime)
returnTrueif__name__=='__main__':
stop_event=threading.Event()
server_thread=threading.Thread(target=server_thread, args=(stop_event,))
server_thread.start()
run_weaviate()
# Set the event to stop the server threadstop_event.set()
server_thread.join()
print('Main script finished')
The text was updated successfully, but these errors were encountered:
Due to the client polling
/v1/.well-known/openid-configuration
to determine the OIDC config, the now-default 90s timeout forinsert
operations seem to dictate the timeout period for the client.It may be preferable to set a separate parameter, or use the
init
value.Script to reproduce (vary the
insert
parameter):The text was updated successfully, but these errors were encountered: