-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[maintenance events] Revert rebind address to initial one after delay #4217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ggivo
wants to merge
25
commits into
redis:master
Choose a base branch
from
ggivo:feature/hu-notifications-rebind-addr-revert
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[maintenance events] Revert rebind address to initial one after delay #4217
ggivo
wants to merge
25
commits into
redis:master
from
ggivo:feature/hu-notifications-rebind-addr-revert
Conversation
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
- Preparation step for processing custom push notifications - Push notification can appear out-of band in-between executed commands - Current Connection implementation does not support out of band Push notifications - Meaning it will crash if "CLIENT TRACKING ON is enabled" on regular Jedis Connection and "invalidation" push event is triggered This commit provides a way to register push handler for the connection which process incoming push messages, before actual command is executed. To preserve backward compatibility unprocessed push messages are forward to application logic as before. - By default Connection will start with NOOP push handler which marks any incoming push event as processed and skips it - On subcsribe/psubscribe a dedicated push handler is registered which propagates to the app only supported push vents such as (message, subscribe, unsubscribe ...) - CacheConection is refactored to use a push handler handling "invalidate" push events only, and skipping any other
This commit adds a new PushHandlerChain class that implements the Chain of Responsibility pattern for Redis RESP3 push message handling. Key features: - Allows composing multiple PushHandlers in a processing chain - Push events propagate through the complete chain in sequence - Events marked as not processed are propagated to the client application - Provides both constructor-based and fluent builder API for chain creation - Includes predefined handlers for common use cases (CONSUME_ALL, PROPAGATE_ALL) - Supports immutable chain transformations via methods like then(), The chain approach provides a flexible way to handle different types of push messages (invalidations, pub/sub, etc.) with specialized handlers while maintaining a clean separation of concerns. Example usage: PushHandlerChain chain = PushHandlerChain.of(loggingHandler) .then(invalidationHandler) .then(PushHandlerChain.PROPAGATE_PUB_SUB_PUSH_HANDLER);
- code clean up - added relaxed timeout configuration - fix unit tests
Register PushInvalidateConsumer after cache is initialised
ConenctionFactory should be rebound before triggering the disposal of Idle connection, so that any newly creaetd are using the proper hostname
Issue : If Maintenace notifications are received during blocking command, relaxTimeout is enforced instead of infinit timeout. Fix: Introduce dedicated relax timeout setting for blocking commands. It will fall back to infinit timeout if not set
# Conflicts: # src/main/java/redis/clients/jedis/MaintenanceEventListener.java # src/main/java/redis/clients/jedis/RebindAware.java # src/test/java/redis/clients/jedis/upgrade/UnifiedJedisProactiveRebindTest.java
2f72bac
to
c9c5149
Compare
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.
Based on PR
Relevant commits: