Conversation
Contributor
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR cleans up the CollectionItemBroker implementation by addressing key removal, error handling (including force unblocked and type mismatches), and improving lock usage and naming for main loop statuses. Key changes include:
- Adding force-unblocked and type mismatch error handling in blocking pop/move commands for SortedSet and List operations.
- Replacing ReaderWriterLockSlim with SingleWriterMultiReaderLock in observers and refining main loop and cleanup logic.
- Refactoring broker event handling to use a union-like struct with explicit field offsets.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| libs/server/Resp/Objects/SortedSetCommands.cs | Added handling for force-unblocked and type mismatch errors in sorted set blocking pop commands. |
| libs/server/Resp/Objects/ListCommands.cs | Introduced type mismatch error handling in blocking list operations. |
| libs/server/Objects/ItemBroker/CollectionItemResult.cs | Updated constructor and static instances to support both force-unblocked and type mismatch flags. |
| libs/server/Objects/ItemBroker/CollectionItemObserver.cs | Switched to SingleWriterMultiReaderLock and added a flag parameter for improved lock management. |
| libs/server/Objects/ItemBroker/CollectionItemBrokerEvent.cs | Reworked event handling to use a union-like struct with explicit layout and new event types. |
| libs/server/Objects/ItemBroker/CollectionItemBroker.cs | Refactored main loop status management, observer cleanup, and updated collection item retrieval. |
Comments suppressed due to low confidence (1)
libs/server/Objects/ItemBroker/CollectionItemBroker.cs:590
- In the TryGetResult method's ListObject branch, the inner switch cases end with a break without returning a value, which may result in the method not returning the intended result. Consider adding an explicit return (e.g., 'return isSuccessful;') after processing the ListObject commands.
case ListObject listObj:
badrishc
reviewed
May 23, 2025
badrishc
approved these changes
May 23, 2025
TedHartMS
approved these changes
May 23, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Addressing some comments / issues with the existing CollectionItemBroker implementation:
Also addressed in this PR -