Skip to content

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

Open
@michalszelagsonos

Description

@michalszelagsonos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions