Skip to content

Commit eee7686

Browse files
committed
Replace failure with snafu
Depends on stackabletech/tokio-zookeeper#44
1 parent 8f3b303 commit eee7686

File tree

4 files changed

+13
-56
lines changed

4 files changed

+13
-56
lines changed

Cargo.lock

Lines changed: 3 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ repository = "https://github.com/stackabletech/zookeeper-operator"
1313
anyhow = "1.0"
1414
built = { version = "0.6", features = ["chrono", "git2"] }
1515
clap = "4.3"
16-
failure = "0.1"
1716
fnv = "1.0"
1817
futures = { version = "0.3", features = ["compat"] }
1918
indoc = "2.0"
@@ -23,7 +22,7 @@ semver = "1.0"
2322
serde = { version = "1.0", features = ["derive"] }
2423
serde_json = "1.0"
2524
serde_yaml = "0.9"
26-
snafu = "0.7"
25+
snafu = "0.8"
2726
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.64.0" }
2827
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.6.0" }
2928
strum = { version = "0.25", features = ["derive"] }
@@ -34,5 +33,6 @@ tracing = "0.1"
3433
# [patch."https://github.com/stackabletech/operator-rs.git"]
3534
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
3635

37-
# [patch.crates-io]
38-
# tokio-zookeeper = { git = "https://github.com/stackabletech/tokio-zookeeper.git", branch = "feature/tokio-modernize" }
36+
[patch.crates-io]
37+
# tokio-zookeeper = { path = "../tokio-zookeeper" }
38+
tokio-zookeeper = { git = "https://github.com/stackabletech/tokio-zookeeper.git", branch = "bugfix/whatever-thread-safety" }

rust/operator-binary/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ stackable-zookeeper-crd = { path = "../crd" }
1414

1515
anyhow.workspace = true
1616
clap.workspace = true
17-
failure.workspace = true
1817
fnv.workspace = true
1918
futures.workspace = true
2019
indoc.workspace = true

rust/operator-binary/src/znode_controller.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -373,38 +373,32 @@ mod znode_mgmt {
373373
AddrResolution { addr: String },
374374
#[snafu(display("failed to connect to {}", addr))]
375375
Connect {
376-
#[snafu(source(from(failure::Error, failure::Error::compat)))]
377-
source: failure::Compat<failure::Error>,
376+
source: tokio_zookeeper::error::Error,
378377
addr: SocketAddr,
379378
},
380379
#[snafu(display("protocol error creating znode {}", path))]
381380
CreateZnodeProtocol {
382-
#[snafu(source(from(failure::Error, failure::Error::compat)))]
383-
source: failure::Compat<failure::Error>,
381+
source: tokio_zookeeper::error::Error,
384382
path: String,
385383
},
386384
#[snafu(display("failed to create znode {}", path))]
387385
CreateZnode {
388-
#[snafu(source(from(tokio_zookeeper::error::Create, failure::Fail::compat)))]
389-
source: failure::Compat<tokio_zookeeper::error::Create>,
386+
source: tokio_zookeeper::error::Create,
390387
path: String,
391388
},
392389
#[snafu(display("protocol error deleting znode {}", path))]
393390
DeleteZnodeProtocol {
394-
#[snafu(source(from(failure::Error, failure::Error::compat)))]
395-
source: failure::Compat<failure::Error>,
391+
source: tokio_zookeeper::error::Error,
396392
path: String,
397393
},
398394
#[snafu(display("failed to delete znode {}", path))]
399395
DeleteZnode {
400-
#[snafu(source(from(tokio_zookeeper::error::Delete, failure::Fail::compat)))]
401-
source: failure::Compat<tokio_zookeeper::error::Delete>,
396+
source: tokio_zookeeper::error::Delete,
402397
path: String,
403398
},
404399
#[snafu(display("failed to find children to delete of {}", path))]
405400
DeleteZnodeFindChildrenProtocol {
406-
#[snafu(source(from(failure::Error, failure::Error::compat)))]
407-
source: failure::Compat<failure::Error>,
401+
source: tokio_zookeeper::error::Error,
408402
path: String,
409403
},
410404
}

0 commit comments

Comments
 (0)