Skip to content

Improve Qdrant collection management with safer alias handling and errors handligs#1062

Merged
pieroit merged 1 commit intocheshire-cat-ai:developfrom
primax79:fix_alias
Apr 14, 2025
Merged

Improve Qdrant collection management with safer alias handling and errors handligs#1062
pieroit merged 1 commit intocheshire-cat-ai:developfrom
primax79:fix_alias

Conversation

@primax79
Copy link
Copy Markdown
Contributor

@primax79 primax79 commented Apr 9, 2025

Description

This PR enhances the reliability of Qdrant collection management by addressing an issue where collection creation could succeed, but alias creation could fail (typically due to timeouts), leading to subsequent errors. Previously, when trying to access aliases, the code would attempt to access the first element of potentially empty alias lists, causing crashes.

The implemented changes include:

Proper error handling with try-catch blocks surrounding both collection and alias creation
Automatic cleanup of collections if the alias creation fails
Informative error messages to help troubleshoot and resolve timeout issues
This fix prevents failures during vector database initialization when Qdrant operations take longer than expected to complete, particularly in resource-constrained environments.

Related to issue #849

Related to PR #1061

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • [] I have commented my code, particularly in hard-to-understand areas

This PR resolves an issue where the system would crash during collection creation if a timeout occurred.
Previously, when the collection creation timed out, no alias was created, and the subsequent check
would fail when trying to access the first element of an empty aliases list.

Changes:
* Improved alias checking by verifying existence before comparison
* Added try-catch blocks in collection creation with helpful error messages suggesting timeout increase
@nickprock
Copy link
Copy Markdown
Contributor

@pieroit it sounds good to me.
Thanks @primax79

@pieroit pieroit merged commit 99016e5 into cheshire-cat-ai:develop Apr 14, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants