weaviate-python-client icon indicating copy to clipboard operation
weaviate-python-client copied to clipboard

Unclosed socket warning sys:1: ResourceWarning: unclosed <socket.socket...

Open michalszelagsonos opened this issue 11 months ago • 0 comments

I am consistently seeing the following warning when using 4.9.3 client with Python 3.12.7 on M1 MacOS 14.7.

sys:1: ResourceWarning: unclosed <socket.socket fd=15, family=2, type=1, proto=6, laddr=('127.0.0.1', 63214), raddr=('127.0.0.1', 11434)>

I am running the DB locally using docker. The image I am running is based on cr.weaviate.io/semitechnologies/weaviate:1.27.2 and has pre-populated data in it.

docker run -p 8080:8080 -p 50051:50051 -e RAFT_ENABLE_ONE_NODE_RECOVERY=true weaviate-with-data:latest

Here's my very simple client code.

import weaviate
import ollama

with weaviate.connect_to_local() as client:
    # get the collection
    collection = client.collections.get(name="foo")

    # get the embedding
    response = ollama.embeddings(model="all-minilm", prompt="bla bla bla")

    # find a vector
    result = collection.query.near_vector(near_vector=response["embedding"], limit=1)

This seems to be the same warning that was reported 2 years ago in #126 on an older version.

michalszelagsonos avatar Nov 16 '24 16:11 michalszelagsonos