WIP: Implement Redis WATCH/UNWATCH commands for optimistic locking #2

Closed
google-labs-jules[bot] wants to merge 1 commit from jules/carade-watch-feature-16176363945607374527 into dev
google-labs-jules[bot] commented 2025-12-18 13:21:13 +00:00 (Migrated from github.com)

Implemented the WATCH and UNWATCH commands to support optimistic locking in transactions. This ensures that if a watched key is modified by another client, the transaction will be aborted. Modified Carade.java to track watched keys and notify clients upon modification. Updated ClientHandler to manage the watch state and transaction dirty flag. Instrumented all write commands (SET, DEL, HSET, etc.) to trigger notifications. Addressed code review feedback regarding thread safety by making transactionDirty volatile and ensuring atomic cleanup in unwatchAll.


PR created automatically by Jules for task 16176363945607374527 started by @irammini

Implemented the `WATCH` and `UNWATCH` commands to support optimistic locking in transactions. This ensures that if a watched key is modified by another client, the transaction will be aborted. Modified `Carade.java` to track watched keys and notify clients upon modification. Updated `ClientHandler` to manage the watch state and transaction dirty flag. Instrumented all write commands (SET, DEL, HSET, etc.) to trigger notifications. Addressed code review feedback regarding thread safety by making `transactionDirty` volatile and ensuring atomic cleanup in `unwatchAll`. --- *PR created automatically by Jules for task [16176363945607374527](https://jules.google.com/task/16176363945607374527) started by @irammini*
google-labs-jules[bot] commented 2025-12-18 13:21:15 +00:00 (Migrated from github.com)

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to **Reactive Mode**. When this mode is on, I will only act on comments where you specifically mention me with `@jules`. You can find this option in the **Pull Request** section of your [global Jules UI settings](https://jules.google.com/settings). You can always switch back! --- *_For security, I will only act on instructions from the user who triggered this task._* New to Jules? Learn more at [jules.google/docs](https://jules.google/docs).

Pull request closed

Sign in to join this conversation.
No description provided.