Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking for existence of key in Collections object causes an infinite stall that consumes all memory #53

Open
martinm07 opened this issue Jun 25, 2024 · 0 comments

Comments

@martinm07
Copy link

Description

When trying to check for the existence of a Collection in client.collections using "collection_name" in client.collections, the program stalls seemingly forever, consuming all the available RAM relatively quickly, regardless of if the collection does indeed exist or not.

Steps to reproduce

import typesense

client = typesense.Client(
    {
        "nodes": [{"host": "localhost", "port": "8108", "protocol": "http"}],
        "api_key": "yourapikey",
        "connection_timeout_seconds": 2,
    }
)

if "documentname" in client.collections:
    print("'documentname' collection exists")

My particular environment is on Windows 10, using Docker Desktop with Docker Engine version 26.1.4 and the typesense container created using

docker run -p "8108:8108" -v "${pwd}/typesense-data:/data" typesense/typesense:26.0 --data-dir "/data" --api-key "$env:TYPESENSE_API_KEY" --enable-cors

on Powershell.

Expected Behavior

Either for it return if the collection exists or not, or to error gracefully.

Actual Behavior

The program stalls forever, consuming more and more RAM until the script is interrupted and the Docker container shut down.

Metadata

Typesense Version: 26.0
typesense-python Version: 0.21.0

OS: Windows 10 x64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant