Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fab8286
feat(grpc): upgrade to Tonic 0.12 and native HTTP 1 types
thomasqueirozb Oct 21, 2026
8ebe8bd
Remove RUSTSECs from deny.toml
thomasqueirozb Oct 21, 2026
278f49b
chore(grpc): trim tests, comments, and unrelated fixes from the Tonic…
thomasqueirozb Oct 21, 2026
39e2b7f
chore(grpc): format and trim decompression channel doc
thomasqueirozb Oct 21, 2026
88b469b
docs(gcp_pubsub source): clarify reset retry changelog
thomasqueirozb Oct 21, 2026
d008cf6
docs(vector sink): rename proxy TLS changelog fragment
thomasqueirozb Oct 21, 2026
4feb532
docs(grpc): add changelog for unregistered gRPC services
thomasqueirozb Oct 21, 2026
3227c87
chore(gcp_pubsub source): drop direct rustls-webpki dependency
thomasqueirozb Oct 21, 2026
d323d44
Move GRPC_MAX_HEADER_LIST_SIZE into vector_common
thomasqueirozb Oct 21, 2026
6c6f4ca
fix(gcp_pubsub source): keep loaded native roots when some entries fail
thomasqueirozb Oct 21, 2026
854900d
feat(api client): use TLS with native roots for https URIs
thomasqueirozb Oct 21, 2026
8887ea2
fix(mqtt): switch rumqttc to native-tls to remove rustls-webpki 0.102
thomasqueirozb Oct 21, 2026
975ce18
Apply suggestion from @thomasqueirozb
thomasqueirozb Oct 21, 2026
0cf546f
fix(mqtt): switch to rumqttc-next to keep rustls with TLS 1.3
thomasqueirozb Oct 21, 2026
ca621cc
Merge remote-tracking branch 'origin/mqtt-drop-rustls-webpki-0.102' i…
thomasqueirozb Oct 21, 2026
ea3d20c
Merge remote-tracking branch 'origin/master' into mqtt-drop-rustls-we…
thomasqueirozb Oct 21, 2026
34f14fa
fix(mqtt sink): stop event loop after the sink stops
thomasqueirozb Oct 21, 2026
c7fea8f
Keep sink alive long enough to drain events
thomasqueirozb Oct 22, 2026
136239c
fix(mqtt sink): drain publishes within the sink lifetime
thomasqueirozb Oct 22, 2026
37c02c1
fix(mqtt): use native draining from rumqttc-v4-next 0.34.0
thomasqueirozb Oct 22, 2026
5118bc7
Merge origin/master into mqtt-sink-stop-event-loop
thomasqueirozb Oct 22, 2026
e78d15c
fix(topology): bound sink reload drains by the shutdown grace period
thomasqueirozb Oct 22, 2026
82325d0
Fix clippy
thomasqueirozb Oct 22, 2026
2c69a3b
fix(topology): account for Windows reload delay in sink reload deadli…
thomasqueirozb Oct 23, 2026
532cedc
docs(changelog): split reload deadline into its own fragment
thomasqueirozb Oct 23, 2026
ad4f710
Remove reload code
thomasqueirozb Oct 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 71 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ rdkafka = { workspace = true, features = ["curl-static", "tokio", "libz", "ssl",
redis = { version = "0.32.4", default-features = false, features = ["connection-manager", "sentinel", "tokio-comp", "tokio-native-tls-comp"], optional = true }
regex.workspace = true
roaring = { version = "0.11.2", default-features = false, features = ["std"], optional = true }
rumqttc = { package = "rumqttc-next", version = "0.26.1", default-features = false, features = ["use-rustls-no-provider"], optional = true }
rumqttc = { package = "rumqttc-v4-next", version = "0.34.0", default-features = false, features = ["use-rustls-no-provider"], optional = true }
# Keep MQTT on Ring alongside Vector's other Rustls users, including in minimal builds.
rustls = { version = "0.23", default-features = false, features = ["logging", "ring", "std", "tls12"], optional = true }
rustls-native-certs = { version = "0.8", default-features = false, optional = true }
Expand Down
5 changes: 4 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ async-stream,https://github.com/tokio-rs/async-stream,MIT,Carl Lerche <me@carlle
async-stream-impl,https://github.com/tokio-rs/async-stream,MIT,Carl Lerche <me@carllerche.com>
async-task,https://github.com/smol-rs/async-task,Apache-2.0 OR MIT,Stjepan Glavina <stjepang@gmail.com>
async-trait,https://github.com/dtolnay/async-trait,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
async-tungstenite,https://github.com/sdroege/async-tungstenite,MIT,Sebastian Dröge <sebastian@centricular.com>
asyncband,https://github.com/fast/asyncband,Apache-2.0,The asyncband Authors
atoi,https://github.com/pacman82/atoi-rs,MIT,Markus Klein
atomic-waker,https://github.com/smol-rs/atomic-waker,Apache-2.0 OR MIT,"Stjepan Glavina <stjepang@gmail.com>, Contributors to futures-rs"
Expand Down Expand Up @@ -504,6 +505,7 @@ mongocrypt,https://github.com/mongodb/libmongocrypt-rust,Apache-2.0,"Abraham Egn
mongocrypt-sys,https://github.com/mongodb/libmongocrypt-rust,Apache-2.0,"Abraham Egnor <abraham.egnor@mongodb.com>, Isabel Atkinson <isabel.atkinson@mongodb.com>"
mongodb,https://github.com/mongodb/mongo-rust-driver,Apache-2.0,"Saghm Rossi <saghmrossi@gmail.com>, Patrick Freed <patrick.freed@mongodb.com>, Isabel Atkinson <isabel.atkinson@mongodb.com>, Abraham Egnor <abraham.egnor@mongodb.com>, Kaitlin Mahar <kaitlin.mahar@mongodb.com>, Patrick Meredith <pmeredit@protonmail.com>"
mongodb-internal-macros,https://github.com/mongodb/mongo-rust-driver,Apache-2.0,"Saghm Rossi <saghmrossi@gmail.com>, Patrick Freed <patrick.freed@mongodb.com>, Isabel Atkinson <isabel.atkinson@mongodb.com>, Abraham Egnor <abraham.egnor@mongodb.com>, Kaitlin Mahar <kaitlin.mahar@mongodb.com>, Patrick Meredith <pmeredit@protonmail.com>"
mqttbytes-core-next,https://github.com/thehouseisonfire/rumqtt,Apache-2.0,tekjar <raviteja@bytebeam.io>
multiversion,https://github.com/calebzulawski/multiversion,MIT OR Apache-2.0,Caleb Zulawski <caleb.zulawski@gmail.com>
multiversion-macros,https://github.com/calebzulawski/multiversion,MIT OR Apache-2.0,Caleb Zulawski <caleb.zulawski@gmail.com>
multiversion_no_op,https://github.com/hsivonen/multiversion_no_op,Apache-2.0 OR MIT,Henri Sivonen <hsivonen@hsivonen.fi>
Expand Down Expand Up @@ -698,7 +700,8 @@ rmpv,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov <division494@gmai
roaring,https://github.com/RoaringBitmap/roaring-rs,MIT OR Apache-2.0,"Wim Looman <wim@nemo157.com>, Kerollmops <kero@meilisearch.com>"
roxmltree,https://github.com/RazrFalcon/roxmltree,MIT OR Apache-2.0,Yevhenii Reizner <razrfalcon@gmail.com>
rsa,https://github.com/RustCrypto/RSA,MIT OR Apache-2.0,"RustCrypto Developers, dignifiedquire <dignifiedquire@gmail.com>"
rumqttc-next,https://github.com/thehouseisonfire/rumqtt,Apache-2.0,tekjar <raviteja@bytebeam.io>
rumqttc-core-next,https://github.com/thehouseisonfire/rumqtt,Apache-2.0,tekjar <raviteja@bytebeam.io>
rumqttc-v4-next,https://github.com/thehouseisonfire/rumqtt,Apache-2.0,tekjar <raviteja@bytebeam.io>
rust_decimal,https://github.com/paupino/rust-decimal,MIT,Paul Mason <paul@form1.co.nz>
rustc-hash,https://github.com/rust-lang/rustc-hash,Apache-2.0 OR MIT,The Rust Project Developers
rustc_version,https://github.com/djc/rustc-version-rs,MIT OR Apache-2.0,The rustc_version Authors
Expand Down
9 changes: 9 additions & 0 deletions changelog.d/mqtt_sink_reload_connection.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The `mqtt` sink now closes its broker connection after the sink stops, for example when a configuration reload removes or replaces it. Before, the connection stayed open after the sink stopped. A replacement sink that uses the same client ID could then be repeatedly disconnected by the broker.

The sink drains queued messages and QoS exchanges as part of its shutdown. A connection error ends the drain without failing a reload or reconnecting a stopped sink.

Vector's `--graceful-shutdown-limit-secs` or `--no-graceful-shutdown-limit` setting now also controls how long old sinks can drain during a configuration reload. All affected sink tasks share one reload deadline. This applies to all sinks, not only MQTT.

The MQTT source and sink now use `rumqttc-v4-next` 0.34.0 and retain MQTT 3.1.1 support.

authors: thomasqueirozb
13 changes: 7 additions & 6 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,10 @@ pub struct RootOpts {
#[arg(long, env = "VECTOR_INTERNAL_LOGS_SOURCE_RATE_LIMIT")]
pub internal_logs_source_rate_limit: Option<NonZeroU64>,

/// Set the duration in seconds to wait for graceful shutdown after SIGINT or SIGTERM are
/// received. After the duration has passed, Vector will force shutdown. To never force
/// shutdown, use `--no-graceful-shutdown-limit`.
/// Set the duration in seconds to wait for graceful shutdown after SIGINT or SIGTERM.
/// Also limit how long old sinks can drain during a configuration reload. After this duration,
/// Vector forces shutdown or stops the old sinks. To wait without a limit, use
/// `--no-graceful-shutdown-limit`.
#[arg(
long,
default_value = "60",
Expand All @@ -248,9 +249,9 @@ pub struct RootOpts {
)]
pub graceful_shutdown_limit_secs: NonZeroU64,

/// Never time out while waiting for graceful shutdown after SIGINT or SIGTERM received.
/// This is useful when you would like for Vector to attempt to send data until terminated
/// by a SIGKILL. Overrides/cannot be set with `--graceful-shutdown-limit-secs`.
/// Never time out while waiting for graceful shutdown or for old sinks to drain during a
/// configuration reload. Vector attempts to send data until it is terminated by SIGKILL.
/// Overrides/cannot be set with `--graceful-shutdown-limit-secs`.
#[arg(
long,
default_value = "false",
Expand Down
5 changes: 3 additions & 2 deletions src/common/mqtt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ impl MqttConnector {

/// Connects the connector and generates a client and eventloop
pub fn connect(&self) -> (AsyncClient, EventLoop) {
let (client, eventloop) = AsyncClient::new(self.options.clone(), 1024);
(client, eventloop)
AsyncClient::builder(self.options.clone())
.capacity(1024)
.build()
}

/// TODO: Right now there is no way to implement the healthcheck properly: <https://github.com/bytebeamio/rumqtt/issues/562>
Expand Down
5 changes: 3 additions & 2 deletions src/sinks/mqtt/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,14 @@ impl MqttSinkConfig {
}
let tls =
MaybeTlsSettings::from_config(self.common.tls.as_ref(), false).context(TlsSnafu)?;
let mut options = MqttOptions::new(&client_id, &self.common.host, self.common.port);
let mut options =
MqttOptions::new(&client_id, (self.common.host.as_str(), self.common.port));
options.set_keep_alive(self.common.keep_alive);
options.set_max_packet_size(self.common.max_packet_size, self.common.max_packet_size);
options.set_clean_session(self.clean_session);
match (&self.common.user, &self.common.password) {
(Some(user), Some(password)) => {
options.set_credentials(user, password);
options.set_credentials(user, password.clone());
}
(None, None) => {}
_ => {
Expand Down
5 changes: 2 additions & 3 deletions src/sinks/mqtt/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ async fn mqtt_happy() {
// prepare consumer
let mut mqtt_options = MqttOptions::new(
"integration-test-consumer",
mqtt_broker_address(),
mqtt_broker_port(),
(mqtt_broker_address(), mqtt_broker_port()),
);
mqtt_options.set_keep_alive(5);

let (client, mut eventloop) = AsyncClient::new(mqtt_options, 10);
let (client, mut eventloop) = AsyncClient::builder(mqtt_options).capacity(10).build();
client
.subscribe("test", QoS::AtLeastOnce)
.await
Expand Down
8 changes: 6 additions & 2 deletions src/sinks/mqtt/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::task::{Context, Poll};

use bytes::Bytes;
use futures::future::BoxFuture;
use rumqttc::{AsyncClient, ClientError};
use rumqttc::{AsyncClient, ClientError, PublishOptions};
use snafu::Snafu;

use super::config::MqttQoS;
Expand Down Expand Up @@ -80,7 +80,11 @@ impl Service<MqttRequest> for MqttService {
let byte_size = req.body.len();

let res = client
.publish(&req.topic, quality_of_service.into(), retain, req.body)
.publish(
req.topic,
req.body,
PublishOptions::new(quality_of_service.into()).retain(retain),
)
.await;
match res {
Ok(()) => Ok(MqttResponse {
Expand Down
Loading
Loading