Skip to content

Commit a360f47

Browse files
authored
Merge branch 'main' into fix/issue-4814-zscan-flake
2 parents 5dc62e7 + 59744fd commit a360f47

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2271
-101
lines changed

.github/workflows/npm-cd.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ jobs:
326326
node-version: latest
327327
registry-url: "https://registry.npmjs.org"
328328
scope: "@valkey"
329-
token: ${{ secrets.NPM_AUTH_TOKEN }}
330329
cache: "npm"
331330
cache-dependency-path: node/package.json
332331

@@ -426,13 +425,13 @@ jobs:
426425
shell: bash
427426
working-directory: ./node/npm/glide
428427
env:
429-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
430428
NPM_TAG: ${{ needs.get-build-parameters.outputs.npm_tag }}
429+
NPM_CONFIG_PROVENANCE: true
431430
run: |
432431
package_name=$(cat package.json | jq -r .name)
433432
version=$(cat package.json | jq -r .version)
434433
echo "Publishing base package ${package_name}@${version} with tag ${NPM_TAG}"
435-
npm publish --tag ${NPM_TAG} --access public --scope=@valkey
434+
npm publish --tag ${NPM_TAG} --access public --provenance --scope=@valkey
436435
437436
# Check if the publish was successful
438437
if [ $? -ne 0 ]; then
@@ -564,7 +563,6 @@ jobs:
564563
with:
565564
node-version: latest
566565
registry-url: "https://registry.npmjs.org"
567-
token: ${{ secrets.NPM_AUTH_TOKEN }}
568566
scope: "@valkey"
569567

570568
- name: Deprecate Published Packages

CHANGELOG.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1+
## 2.3
2+
3+
#### Changes
4+
5+
* JAVA: Add EVAL_RO, EVALSHA_RO, and SCRIPT DEBUG commands ([#5125](https://github.com/valkey-io/valkey-glide/pull/5125))
6+
* CORE: Add client certificate and private key support for mTLS ([#5092](https://github.com/valkey-io/valkey-glide/issues/5092))
7+
* Python: Add client certificate and private key support for mTLS ([5123](https://github.com/valkey-io/valkey-glide/issues/5123))
8+
9+
#### Fixes
10+
* CORE: Enforce connection_timeout for initial standalone connection failures ([#4991](https://github.com/valkey-io/valkey-glide/issues/4991))
11+
* CORE: Rust Lint is failing due to unmaintained advisory detected (RUSTSEC-2025-0141) ([#5136](https://github.com/valkey-io/valkey-glide/issues/5136))
12+
* Node: Fixed `Failed to convert napi value Undefined into rust type u32` error ([#5128](https://github.com/valkey-io/valkey-glide/pull/5128))
13+
14+
#### Operational Enhancements
15+
116
## 2.2
217

318
#### Changes
419

5-
* Added in documentation to how to use Lua scripts with Glide
20+
* Added in documentation to how to use Lua scripts with Glide
621
* JAVA: Add refreshTopologyFromInitialNodes Configuration Option ([#4870](https://github.com/valkey-io/valkey-glide/pull/4870))
722
* GO: add RefreshTopologyFromInitialNodes configuration option ([#4871](https://github.com/valkey-io/valkey-glide/pull/4871))
823
* Node: add refreshTopologyFromInitialNodes configuration option ([#4872](https://github.com/valkey-io/valkey-glide/pull/4872))
@@ -45,7 +60,7 @@
4560
* PYTHON: Add MOVE command support for cluster clients ([#4751](https://github.com/valkey-io/valkey-glide/pull/4751))
4661
* JAVA: Add cluster support for Move command ([#4749])(https://github.com/valkey-io/valkey-glide/pull/4749)
4762

48-
#### Fixes
63+
#### Fixes
4964

5065
* CORE: Fix SELECT Command Database Persistence Across Reconnections ([#4764](https://github.com/valkey-io/valkey-glide/issues/4764))
5166
* Rust: Updates the `install-rust-and-protoc` action to explicitly include the `rustfmt` and `clippy` components. ([#4816](https://github.com/valkey-io/valkey-glide/issues/4816))

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Valkey GLIDE has a growing ecosystem of integrations and extensions that enhance
118118
- **[aiocache](https://pypi.org/project/aiocache/)** - Python async caching framework with Valkey GLIDE backend support for high-performance distributed caching
119119
- **[aws-lambda-powertools-typescript](https://github.com/aws-powertools/powertools-lambda-typescript)** - AWS Lambda Powertools for TypeScript with Valkey GLIDE integration in the idempotency feature (more integrations planned)
120120
- **[aws-lambda-powertools-python](https://github.com/aws-powertools/powertools-lambda-python)** - AWS Lambda Powertools for Python with Valkey GLIDE support in the idempotency feature (more integrations planned)
121+
- **[redlock-universal](https://www.npmjs.com/package/redlock-universal)** - Distributed lock library for Node.js with native GLIDE adapter, featuring auto-extension and atomic batch acquisition
121122

122123
## Getting Help
123124

deny.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ yanked = "deny"
2222
# A list of advisory IDs to ignore. Note that ignored advisories will still
2323
# output a note when they are encountered.
2424
ignore = [
25-
# suppress this validation until #3226 not resolved
26-
# https://github.com/valkey-io/valkey-glide/issues/3226
27-
"RUSTSEC-2025-0007",
25+
# bincode is unmaintained but only used as a transitive dev dependency
26+
# via iai-callgrind for benchmarking. No security impact.
27+
# https://rustsec.org/advisories/RUSTSEC-2025-0141
28+
"RUSTSEC-2025-0141",
2829
]
2930
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
3031
# lower than the range specified will be ignored. Note that ignored advisories

glide-core/redis-rs/redis/src/aio/connection.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,13 @@ where
419419
pub(crate) async fn connect_simple<T: RedisRuntime>(
420420
connection_info: &ConnectionInfo,
421421
_socket_addr: Option<SocketAddr>,
422+
tcp_nodelay: bool,
422423
) -> RedisResult<(T, Option<IpAddr>)> {
423424
Ok(match connection_info.addr {
424425
ConnectionAddr::Tcp(ref host, port) => {
425426
if let Some(socket_addr) = _socket_addr {
426427
return Ok::<_, RedisError>((
427-
<T>::connect_tcp(socket_addr).await?,
428+
<T>::connect_tcp(socket_addr, tcp_nodelay).await?,
428429
Some(socket_addr.ip()),
429430
));
430431
}
@@ -433,7 +434,7 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
433434
log_conn_creation("TCP", format!("{host}:{port}"), Some(socket_addr.ip()));
434435
Box::pin(async move {
435436
Ok::<_, RedisError>((
436-
<T>::connect_tcp(socket_addr).await?,
437+
<T>::connect_tcp(socket_addr, tcp_nodelay).await?,
437438
Some(socket_addr.ip()),
438439
))
439440
})
@@ -450,7 +451,8 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
450451
} => {
451452
if let Some(socket_addr) = _socket_addr {
452453
return Ok::<_, RedisError>((
453-
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params).await?,
454+
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params, tcp_nodelay)
455+
.await?,
454456
Some(socket_addr.ip()),
455457
));
456458
}
@@ -463,7 +465,8 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
463465
);
464466
Box::pin(async move {
465467
Ok::<_, RedisError>((
466-
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params).await?,
468+
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params, tcp_nodelay)
469+
.await?,
467470
Some(socket_addr.ip()),
468471
))
469472
})

glide-core/redis-rs/redis/src/aio/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ pub mod tokio;
2929
#[async_trait]
3030
pub(crate) trait RedisRuntime: AsyncStream + Send + Sync + Sized + 'static {
3131
/// Performs a TCP connection
32-
async fn connect_tcp(socket_addr: SocketAddr) -> RedisResult<Self>;
32+
async fn connect_tcp(socket_addr: SocketAddr, tcp_nodelay: bool) -> RedisResult<Self>;
3333

3434
// Performs a TCP TLS connection
3535
async fn connect_tcp_tls(
3636
hostname: &str,
3737
socket_addr: SocketAddr,
3838
insecure: bool,
3939
tls_params: &Option<TlsConnParams>,
40+
tcp_nodelay: bool,
4041
) -> RedisResult<Self>;
4142

4243
/// Performs a UNIX connection

glide-core/redis-rs/redis/src/aio/tokio.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ use crate::tls::TlsConnParams;
2525
use super::Path;
2626

2727
#[inline(always)]
28-
async fn connect_tcp(addr: &SocketAddr) -> io::Result<TcpStreamTokio> {
28+
async fn connect_tcp(addr: &SocketAddr, tcp_nodelay: bool) -> io::Result<TcpStreamTokio> {
2929
let socket = TcpStreamTokio::connect(addr).await?;
30+
socket.set_nodelay(tcp_nodelay)?;
3031
#[cfg(feature = "keep-alive")]
3132
{
3233
//For now rely on system defaults
@@ -111,23 +112,26 @@ impl AsyncRead for Tokio {
111112

112113
#[async_trait]
113114
impl RedisRuntime for Tokio {
114-
async fn connect_tcp(socket_addr: SocketAddr) -> RedisResult<Self> {
115-
Ok(connect_tcp(&socket_addr).await.map(Tokio::Tcp)?)
115+
async fn connect_tcp(socket_addr: SocketAddr, tcp_nodelay: bool) -> RedisResult<Self> {
116+
Ok(connect_tcp(&socket_addr, tcp_nodelay)
117+
.await
118+
.map(Tokio::Tcp)?)
116119
}
117120

118121
async fn connect_tcp_tls(
119122
hostname: &str,
120123
socket_addr: SocketAddr,
121124
insecure: bool,
122125
tls_params: &Option<TlsConnParams>,
126+
tcp_nodelay: bool,
123127
) -> RedisResult<Self> {
124128
let config = create_rustls_config(insecure, tls_params.clone())?;
125129
let tls_connector = TlsConnector::from(Arc::new(config));
126130

127131
Ok(tls_connector
128132
.connect(
129133
rustls_pki_types::ServerName::try_from(hostname)?.to_owned(),
130-
connect_tcp(&socket_addr).await?,
134+
connect_tcp(&socket_addr, tcp_nodelay).await?,
131135
)
132136
.await
133137
.map(|con| Tokio::TcpTls(Box::new(con)))?)

glide-core/redis-rs/redis/src/client.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ pub struct GlideConnectionOptions {
9696
pub connection_timeout: Option<Duration>,
9797
/// Retry strategy configuration for reconnect attempts.
9898
pub connection_retry_strategy: Option<RetryStrategy>,
99+
/// TCP_NODELAY socket option. When true, disables Nagle's algorithm for lower latency.
100+
/// When false, enables Nagle's algorithm to reduce network overhead.
101+
pub tcp_nodelay: bool,
99102
}
100103

101104
/// To enable async support you need to enable the feature: `tokio-comp`
@@ -115,7 +118,10 @@ impl Client {
115118
let (con, _ip) = match Runtime::locate() {
116119
#[cfg(feature = "tokio-comp")]
117120
Runtime::Tokio => {
118-
self.get_simple_async_connection::<crate::aio::tokio::Tokio>(None)
121+
// Note: tcp_nodelay is hardcoded to true (default) since this deprecated API
122+
// doesn't accept GlideConnectionOptions. Modern code should use
123+
// get_multiplexed_async_connection which allows configuring tcp_nodelay.
124+
self.get_simple_async_connection::<crate::aio::tokio::Tokio>(None, true)
119125
.await?
120126
}
121127
};
@@ -427,7 +433,9 @@ impl Client {
427433
where
428434
T: crate::aio::RedisRuntime,
429435
{
430-
let (con, ip) = self.get_simple_async_connection::<T>(socket_addr).await?;
436+
let (con, ip) = self
437+
.get_simple_async_connection::<T>(socket_addr, glide_connection_options.tcp_nodelay)
438+
.await?;
431439
crate::aio::MultiplexedConnection::new_with_response_timeout(
432440
&self.connection_info,
433441
con,
@@ -441,6 +449,7 @@ impl Client {
441449
async fn get_simple_async_connection<T>(
442450
&self,
443451
socket_addr: Option<SocketAddr>,
452+
tcp_nodelay: bool,
444453
) -> RedisResult<(
445454
Pin<Box<dyn crate::aio::AsyncStream + Send + Sync>>,
446455
Option<IpAddr>,
@@ -449,7 +458,8 @@ impl Client {
449458
T: crate::aio::RedisRuntime,
450459
{
451460
let (conn, ip) =
452-
crate::aio::connect_simple::<T>(&self.connection_info, socket_addr).await?;
461+
crate::aio::connect_simple::<T>(&self.connection_info, socket_addr, tcp_nodelay)
462+
.await?;
453463
Ok((conn.boxed(), ip))
454464
}
455465

@@ -519,11 +529,11 @@ impl Client {
519529
///
520530
/// let mut con = client.get_async_connection(None).await?;
521531
///
522-
/// con.set("key1", b"foo").await?;
532+
/// con.set::<_, _, ()>("key1", b"foo").await?;
523533
///
524534
/// redis::cmd("SET")
525535
/// .arg(&["key2", "bar"])
526-
/// .query_async(&mut con)
536+
/// .query_async::<_, ()>(&mut con)
527537
/// .await?;
528538
///
529539
/// let result = redis::cmd("MGET")

glide-core/redis-rs/redis/src/cluster_async/connections_logic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ where
193193
discover_az,
194194
connection_timeout: Some(params.connection_timeout),
195195
connection_retry_strategy: None,
196+
tcp_nodelay: params.tcp_nodelay,
196197
},
197198
)
198199
.await

glide-core/redis-rs/redis/src/cluster_async/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,7 @@ where
11321132
discover_az,
11331133
connection_timeout: Some(cluster_params.connection_timeout),
11341134
connection_retry_strategy: Some(connection_retry_strategy),
1135+
tcp_nodelay: cluster_params.tcp_nodelay,
11351136
};
11361137

11371138
let connections = Self::create_initial_connections(

0 commit comments

Comments
 (0)