Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 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 @@ -94,7 +94,7 @@ rust-version = "1.82"
publish = false

[workspace.dependencies]
async-nats = { version = "0.39.0", features = ["service"] }
async-nats = { git = "https://github.com/systeminit/nats.rs.git", branch = "nick/d94750e", features = ["service"] }
async-openai = "0.26.0"
async-recursion = "1.1.1"
async-trait = "0.1.83"
Expand Down
19 changes: 6 additions & 13 deletions lib/veritech-server/src/heartbeat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,11 @@ impl HeartbeatApp {
Err(err) => {
error!(si.error.message = ?err, "heartbeat: publish error");
metric!(counter.veritech.heartbeat.publish.error = 1);
self.needs_force_reconnect = true;
}
},
// NOTE(nick): this is going to be an "Elapsed" error, which contains a single private
// field: the unit type. As a result of this, we cannot match on the specific error. I
// don't love the underscore here in case the underlying API changes, but here we are.
Err(_) => {
metric!(counter.veritech.heartbeat.publish.timeout = 1);

// How do we know we need to reconnect? We are unable to publish in a reasonable timeframe.
self.needs_force_reconnect = true;
}
}
Expand Down Expand Up @@ -164,10 +160,6 @@ impl HeartbeatApp {
}

async fn perform_force_reconnect(&mut self) {
// NOTE(nick): consider not blocking heartbeats when performing force reconnection.
// This is tricky because you don't want to pile on the pain if you need to force a
// reconnection, but we also may not want to block heartbeats. We could go either way
// on this one, but the current stance should be sufficient.
match tokio::time::timeout(
self.force_reconnect_timeout_duration,
self.nats.force_reconnect(),
Expand All @@ -182,12 +174,13 @@ impl HeartbeatApp {
Err(err) => {
error!(si.error.message = ?err, "heartbeat: force reconnect error");
metric!(counter.veritech.heartbeat.force_reconnect.error = 1);
self.needs_force_reconnect = true;
}
},
// NOTE(nick): this is going to be an "Elapsed" error, which contains a single private
// field: the unit type. As a result of this, we cannot match on the specific error. I
// don't love the underscore here in case the underlying API changes, but here we are.
Err(_) => metric!(counter.veritech.heartbeat.force_reconnect.timeout = 1),
Err(_) => {
metric!(counter.veritech.heartbeat.force_reconnect.timeout = 1);
self.needs_force_reconnect = true;
}
}
}
}
21 changes: 10 additions & 11 deletions third-party/rust/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ git_fetch(
visibility = [],
)

git_fetch(
name = "nats.rs-639306d6e61a4ca7.git",
repo = "https://github.com/systeminit/nats.rs.git",
rev = "f9468de5062d60d5bb4c77f51da164323688d6ff",
visibility = [],
)

git_fetch(
name = "rust-s3-61c54947c717d042.git",
repo = "https://github.com/ScuffleTV/rust-s3.git",
Expand Down Expand Up @@ -606,22 +613,14 @@ alias(
visibility = ["PUBLIC"],
)

http_archive(
name = "async-nats-0.39.0.crate",
sha256 = "a798aab0c0203b31d67d501e5ed1f3ac6c36a329899ce47fc93c3bea53f3ae89",
strip_prefix = "async-nats-0.39.0",
urls = ["https://static.crates.io/crates/async-nats/0.39.0/download"],
visibility = [],
)

cargo.rust_library(
name = "async-nats-0.39.0",
srcs = [":async-nats-0.39.0.crate"],
srcs = [":nats.rs-639306d6e61a4ca7.git"],
crate = "async_nats",
crate_root = "async-nats-0.39.0.crate/src/lib.rs",
crate_root = "nats.rs-639306d6e61a4ca7/async-nats/src/lib.rs",
edition = "2021",
env = {
"CARGO_MANIFEST_DIR": "async-nats-0.39.0.crate",
"CARGO_MANIFEST_DIR": "nats.rs-639306d6e61a4ca7",
"CARGO_PKG_AUTHORS": "Tomasz Pietrek <tomasz@nats.io>:Casper Beyer <caspervonb@pm.me>",
"CARGO_PKG_DESCRIPTION": "A async Rust NATS client",
"CARGO_PKG_NAME": "async-nats",
Expand Down
3 changes: 1 addition & 2 deletions third-party/rust/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 third-party/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ rust-version = "1.82"
publish = false

[dependencies]
async-nats = { version = "0.39.0", features = ["service"] }
async-nats = { git = "https://github.com/systeminit/nats.rs.git", branch = "nick/d94750e", features = ["service"] }
async-openai = "0.26.0"
async-recursion = "1.1.1"
async-trait = "0.1.83"
Expand Down