Open
Description
Describe the problem
@app.get("/get_collections")
async def get_collections():
try:
client = HttpClient(host="127.0.0.1", port=8800)
response = client.list_collections()
result = []
for i in response:
temp = {
"id": i.id,
"name":i.name,
"count":await i.count()
}
result.append(temp)
return result
except Exception as e:
raise
When I encapsulate ChromaDB-related services as APIs using FastAPI, each API call generates a new TCP connection that isn't released after completion. During frequent 'add' operations, this leads to a massive accumulation of temporary ports being occupied, eventually causing the process to freeze.
While AsyncHttpClient doesn't have this issue, I want to add an explicit close() method to HttpClient for actively terminating requests.
Describe the proposed solution
I want to add a close method to the client to improve request management.
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response