Skip to content
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

Add connection retry #770

Merged
merged 1 commit into from
Mar 19, 2024
Merged
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
121 changes: 3 additions & 118 deletions Cargo.lock

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

44 changes: 44 additions & 0 deletions DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,31 @@
/// For TCP/UDP on Linux, it is possible additionally specify the interface to be connected to:
/// E.g. tcp/192.168.0.1:7447#iface=eth0, for connect only if the IP address is reachable via the interface eth0
connect: {
/// timeout waiting for all endpoints connected (0: no retry, -1: infinite timeout)
/// Accepts a single value or different values for router, peer and client.
timeout_ms: { router: -1, peer: -1, client: 0 },

endpoints: [
// "<proto>/<address>"
],

/// Global connect configuration,
/// Accepts a single value or different values for router, peer and client.
/// The configuration can also be specified for the separate endpoint
/// it will override the global one
/// E.g. tcp/192.168.0.1:7447#retry_period_init_ms=20000;retry_period_max_ms=10000"

/// exit from application, if timeout exceed
exit_on_failure: { router: false, peer: false, client: true },
/// connect establishing retry configuration
retry: {
/// intial wait timeout until next connect try
period_init_ms: 1000,
/// maximum wait timeout until next connect try
period_max_ms: 4000,
/// increase factor for the next timeout until nexti connect try
period_increase_factor: 2,
},
},

/// Which endpoints to listen on. E.g. tcp/localhost:7447.
Expand All @@ -33,9 +55,31 @@
/// For TCP/UDP on Linux, it is possible additionally specify the interface to be listened to:
/// E.g. tcp/0.0.0.0:7447#iface=eth0, for listen connection only on eth0
listen: {
/// timeout waiting for all listen endpoints (0: no retry, -1: infinite timeout)
/// Accepts a single value or different values for router, peer and client.
timeout_ms: 0,

endpoints: [
// "<proto>/<address>"
],

/// Global listen configuration,
/// Accepts a single value or different values for router, peer and client.
/// The configuration can also be specified for the separate endpoint
/// it will override the global one
/// E.g. tcp/192.168.0.1:7447#exit_on_failure=false;retry_period_max_ms=1000"

/// exit from application, if timeout exceed
exit_on_failure: true,
/// listen retry configuration
retry: {
/// intial wait timeout until next try
period_init_ms: 1000,
/// maximum wait timeout until next try
period_max_ms: 4000,
/// increase factor for the next timeout until next try
period_increase_factor: 2,
},
},
/// Configure the scouting mechanisms and their behaviours
scouting: {
Expand Down
1 change: 1 addition & 0 deletions commons/zenoh-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ categories = { workspace = true }
description = "Internal crate for zenoh."

[dependencies]
log = { workspace = true }
flume = { workspace = true }
json5 = { workspace = true }
num_cpus = { workspace = true }
Expand Down
Loading