Improve Qdrant collection management with safer alias handling and errors handligs#1062
Merged
pieroit merged 1 commit intocheshire-cat-ai:developfrom Apr 14, 2025
Merged
Conversation
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
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Checklist: