Skip to content

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

@martinm07

Description

@martinm07

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

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