You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was getting timeout errors when starting a service just upgraded to async-nats v0.36. I narrowed the problem to create_consumer. We are running the nats server v2.8 (had some other services using an ancient version of the [sync] nats crate, so we can't upgrade yet).
I tried upgrading the server to 2.9 and 2.10 in a test cluster and both work well. Also downgrading async-nats to 0.35.1 works just ok, so I'm only seeing the errors with the combination of async-nats v0.36.0 and server v2.8.
I tried to do a simpler version of my application code to reproduce the problem. In this simpler version, somehow I don't see a timeout error, but create_stream never returns, just gets stuck. Once again, server v2.9+ works with both versions of the crate, and crate version 0.35.1 does work with server 2.8.
// main.rsuse async_nats::jetstream::consumer::pull::ConfigasPullConfig;use async_nats::jetstream::stream::{ConfigasStreamConfig,DiscardPolicy};use async_nats::{connect, jetstream};use std::time::Duration;use tokio::time::sleep;#[tokio::main]asyncfnmain(){let client = connect("localhost:34222").await.unwrap();let jetstream = jetstream::new(client);let _ = jetstream.delete_stream("test").await;println!("Creating stream");let stream = jetstream
.create_stream(StreamConfig{name:"test".to_string(),max_messages:100_000,discard:DiscardPolicy::Old,
..Default::default()}).await.unwrap();println!("Creating consumer");
stream
.create_consumer(PullConfig{durable_name:Some("test-consumer".to_string()),
..PullConfig::default()}).await.unwrap();println!("Done!");// This never prints when using async-nats v0.36 and nats v2.8sleep(Duration::from_secs(5)).await;}
# Cargo.toml
[package]
name = "nats-timeout"version = "0.1.0"edition = "2021"
[dependencies]
async-nats = { version = "0.36", default-features = false, features = ["ring"] }
tokio = { version = "1.40.0", features = ["macros", "rt", "rt-multi-thread"] }
Expected behavior
create_consumer never hangs
Server and client version
Server: nats v2.8 (just pulled from the official nats:2.8 docker hub image)
Client: async-nats 0.36.0
Host environment
Tested in docker for windows, engine version v27.1.1.
The error also appears in our staging and production servers, which are running docker in linux.
Steps to reproduce
Launch nats server v2.8 (for instance using the docker image)
Run the example code
The text was updated successfully, but these errors were encountered:
Observed behavior
I was getting timeout errors when starting a service just upgraded to async-nats v0.36. I narrowed the problem to create_consumer. We are running the nats server v2.8 (had some other services using an ancient version of the [sync] nats crate, so we can't upgrade yet).
I tried upgrading the server to 2.9 and 2.10 in a test cluster and both work well. Also downgrading async-nats to 0.35.1 works just ok, so I'm only seeing the errors with the combination of async-nats v0.36.0 and server v2.8.
I tried to do a simpler version of my application code to reproduce the problem. In this simpler version, somehow I don't see a timeout error, but
create_stream
never returns, just gets stuck. Once again, server v2.9+ works with both versions of the crate, and crate version 0.35.1 does work with server 2.8.Expected behavior
create_consumer
never hangsServer and client version
Server: nats v2.8 (just pulled from the official nats:2.8 docker hub image)
Client: async-nats 0.36.0
Host environment
Tested in docker for windows, engine version v27.1.1.
The error also appears in our staging and production servers, which are running docker in linux.
Steps to reproduce
The text was updated successfully, but these errors were encountered: