GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — Mark connections broken on protocol I/O failures by lh0156 · Pull Request #4549 · redis/jedis Conversation
|
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the PR — the team will take a look as soon as we have free cycles. In the meantime, to get the formatting checks passing, please add the new files to the formatter config in pom.xml and run mvn format over them. That should resolve the current CI failures. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the guidance. I added the new test file to the formatter config, ran the formatter, and pushed the fix in 724d5ee. I also verified locally with:
The GitHub Actions workflows on the latest commit currently show as action_required, so I’m waiting for them to be approved/rerun. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@lh0156 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR hardens redis.clients.jedis.Connection error handling so that protocol I/O failures (write/flush/read/push paths) reliably mark a connection as broken, preventing pooled connections with potentially contaminated RESP state from being reused (fixes #4278).
Changes:
Connection to mark broken on protocol send/flush/read/push failures (notably JedisConnectionException and Error) and to reject reads/writes once broken.sendCommand fails, while ensuring the connection is already marked broken first.Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/java/redis/clients/jedis/Connection.java | Marks connections broken on key protocol failure paths and adds broken-state guards. |
| src/test/java/redis/clients/jedis/ConnectionErrorHandlingTest.java | Adds focused tests covering broken-state behavior across send/flush/read/push and pool invalidation scenarios. |
| pom.xml | Registers the new test file in the formatter plugin includes list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@lh0156 adding also @atakavci for another pair of review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
i suggest to investigate if connect outside of tyry-block 💯 safe
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit cd826b2. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
9d725fa to
cd826b2
Compare
There was an error while loading. Please reload this page.
|
Nice work! I did another review pass, and I think the main remaining gap is hardening the Specifically, there is still a window in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the review. I addressed the remaining After a command is sent, reply consumption now goes through For I also added regression coverage for the builder lookup case and verified locally with: mvn -B -Dwith-param-names=true -Dtest=ConnectionErrorHandlingTest test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Wrap healthy-connection tests in try-with-resources - Suppress resource lint on tests using failing output streams - Add dedicated close-on-broken-flush tests
0fb52b7 to
a90040e
Compare
There was an error while loading. Please reload this page.
|
Did some tests with the provided reproduction example, suggested with the original issue, and confirmed that the buffer corruption was not observed. Thanks for taking care of the unstable tests. They don't seem related to the current change, so I will suggest extracting them in a dedicated PR. If you don't mind, I will take it from here, perform a small cleanup, and move on to merging it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
tracking issue for flaky |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This reverts commit 6641f2c.
Data errors (JedisDataException) remain exempt since the stream stays aligned.
Guard exceptions were cause-less, so cleanup paths (e.g. tx.close()) masked the root failure. The first cause marking the connection broken is now attached to the write/read guard exceptions.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Merged! Thanks for seeing this through, @lh0156 I reverted |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Input Stream Not Cleaned Up on Errors May Lead to Buffer Corruption
There was an error while loading. Please reload this page.