first thanks for your work !
I started etcd ok , the restful can used .
bu when use this client it report:
"grpc-status: Unknown, grpc-message: \"Service was not ready: transport error: buffer\\\'s worker closed unexpectedly\""`', src/etcd_client.rs:179:13
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:77
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:59
4: core::fmt::write
at src/libcore/fmt/mod.rs:1052
5: std::io::Write::write_fmt
at /rustc/41f41b2354778375dc72f7ed1d9323626580dc4d/src/libstd/io/mod.rs:1426
6: std::io::impls::<impl std::io::Write for alloc::boxed::Box<W>>::write_fmt
at src/libstd/io/impls.rs:156
7: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:62
8: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
9: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:204
10: std::panicking::default_hook
at src/libstd/panicking.rs:221
11: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:472
12: rust_begin_unwind
at src/libstd/panicking.rs:380
13: std::panicking::begin_panic_fmt
at src/libstd/panicking.rs:334
14: any_client::etcd_client::test_etcd_kv
at src/etcd_client.rs:179
15: any_client::etcd_client::test_etcd_kv::{{closure}}
at src/etcd_client.rs:173
16: core::ops::function::FnOnce::call_once
at /rustc/41f41b2354778375dc72f7ed1d9323626580dc4d/src/libcore/ops/function.rs:232
17: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
at /rustc/41f41b2354778375dc72f7ed1d9323626580dc4d/src/liballoc/boxed.rs:1015
18: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:86
19: std::panicking::try
at /rustc/41f41b2354778375dc72f7ed1d9323626580dc4d/src/libstd/panicking.rs:281
20: std::panic::catch_unwind
at /rustc/41f41b2354778375dc72f7ed1d9323626580dc4d/src/libstd/panic.rs:394
21: test::run_test_in_process
at src/libtest/lib.rs:539
22: test::run_test::run_test_inner::{{closure}}
at src/libtest/lib.rs:452
my code is
// new client
pub fn new(addr: &str) -> EtcdCli {
match Runtime::new()
.unwrap()
.block_on(Client::connect(ClientConfig {
endpoints: vec![addr.to_owned()],
auth: None,
})) {
Ok(c) => EtcdCli { client: c },
Err(e) => panic!("conn master server has err:{}", e.to_string()),
}
}
//set
pub fn set(&self, key: &str, value: &str, ttl: u64) -> ASResult<KValue> {
let mut req = PutRequest::new(key, value);
req.set_lease(ttl);
match Runtime::new().unwrap().block_on(self.client.kv().put(req)) {
Ok(mut r) => match r.take_prev_kv() {
Some(kv) => {
return Ok(KValue {
key: kv.key_str().to_string(),
value: kv.value_str().to_string(),
})
}
None => return Err(err_generic()),
},
Err(e) => {
return Err(err_code(INTERNAL_ERR, e.to_string()));
}
}
}