Skip to content

Rust clean up - Refactor Redis connection handling and remove ACL and script features #3976

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

Merged

Conversation

avifenesh
Copy link
Member

@avifenesh avifenesh commented May 26, 2025

The goal is to do small iteration and to remove dead code from redis-rs, to enhance the ability to maintain the code, and to reduce the size.

Our code size, for languages which aim to create smaller bundles and to run on dockers/lambda/any other bundled code, like python and Node.js, is a considerable chunk. We have many users comparing our code to other libraries and complaining.
While our code will stay more heavy than other packages, the current size reaches 6 MB, and has no logical reason to do so.
Most of our rust code is a dead code.
By iterating feature by feature we should clean up this code, for better user experience, build time, developer experience and maintainability.

Cleaning redis-rs code:

  • Removing keep-alive feature.
  • Removed ACL feature.
  • Removed code using those features.
  • Deleted the script feature.
  • Updated tests to remove references to removed features.
  • Improved port availability checks in test utilities to reduce race conditions.

Issue link

This Pull Request is linked to issue #3650

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

@avifenesh avifenesh requested a review from a team as a code owner May 26, 2025 05:38
@avifenesh avifenesh force-pushed the feature/remove-unused-redis-rs-features branch 6 times, most recently from 7d48dab to 6f41d51 Compare May 26, 2025 06:23
@avifenesh avifenesh added Optimization Optimization matter such as cleaner code, performance etc Users Pain An issue known to cause users pain, generaly open by the user. Rust Pull requests that update rust code labels May 26, 2025
@avifenesh avifenesh added this to the 2.1 milestone May 26, 2025
@avifenesh avifenesh force-pushed the feature/remove-unused-redis-rs-features branch 2 times, most recently from 27dd570 to a0cd3cb Compare May 26, 2025 08:50
@avifenesh avifenesh requested review from jbrinkman, Yury-Fridlyand and meitalkra and removed request for shohamazon, ikolomi and meitalkra May 26, 2025 18:28
@avifenesh avifenesh force-pushed the feature/remove-unused-redis-rs-features branch from 95d3b34 to d2a6f7f Compare May 27, 2025 09:46
Copy link
Collaborator

@barshaul barshaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments inline

@avifenesh avifenesh force-pushed the feature/remove-unused-redis-rs-features branch 2 times, most recently from efd1953 to f654523 Compare May 27, 2025 13:26
- Removed ACL command implementations from `mod.rs` and associated tests.
- Cleaned up connection handling in `connection.rs` by simplifying TLS configuration.
- Deleted the `script.rs` module and its related tests
- Updated various test files to remove references to script-related tests.
- Adjusted cluster tests to improve key handling and slot calculations.
- Enhanced utility functions for better TLS setup in tests.

Signed-off-by: Avi Fenesh <[email protected]>
@avifenesh avifenesh force-pushed the feature/remove-unused-redis-rs-features branch from f654523 to 2f57463 Compare May 27, 2025 16:47
- Updated various dependencies in Cargo.toml to use more concise version specifications.
- Removed geospatial example and related commands from the Redis crate.
- Eliminated geospatial-related tests and support files.
- Refactored random number generation to use the new `rand::rng()` method.

Signed-off-by: Avi Fenesh <[email protected]>
@avifenesh avifenesh requested a review from barshaul May 27, 2025 18:44
@avifenesh
Copy link
Member Author

@barshaul ready

@avifenesh avifenesh merged commit d970659 into valkey-io:main May 29, 2025
63 checks passed
@avifenesh avifenesh deleted the feature/remove-unused-redis-rs-features branch May 29, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Optimization Optimization matter such as cleaner code, performance etc Rust Pull requests that update rust code Users Pain An issue known to cause users pain, generaly open by the user.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants