Coder Social home page Coder Social logo

rust-etcd's Introduction

etcd

Build Status

An etcd client library for Rust.

Running the tests

  • Install Docker and Docker Compose.
  • Run make. This will drop you into a Bash shell in a container.
  • Inside the container, run cargo test.

License

MIT

rust-etcd's People

Contributors

arthurprs avatar emef avatar jimmycuadra avatar jsanders avatar mehcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rust-etcd's Issues

Build failure under Rust 0.11.0

   Compiling etcd v0.5.4
/home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27:37: 27:50 error: mismatched types [E0308]
/home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27             serde_codegen::register(&mut registry);
                                                                                                                           ^~~~~~~~~~~~~
/home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27:37: 27:50 help: run `rustc --explain E0308` to see a detailed explanation
/home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27:37: 27:50 note: expected type `&mut syntex::Registry`
/home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27:37: 27:50 note:    found type `&mut inner::syntex::Registry`
error: aborting due to previous error
error: Could not compile `etcd`.

To learn more, run the command again with --verbose.

watch_recursive test is not deterministic

Some time in the last few commits, the watch_recursive integration test has started hanging (never completing) indicating a race condition. I'm not sure whether it was from a change to the library or an update of a dependency that caused it to start doing this, so I'm not sure of the root cause. Needs to be investigated.

Connection leak from watch timeout.

I'm using the watch timeout set to 10s. If we've not received a change notification by then I ping the downstream service anyway and then restart the watch. Unfortunately, this leaks a connection every 10s if there is no activity in etcd.

I assume this is due to the rust-etcd watch integration with hyper. Let me know if you would like any specific diagnostics.

build fails to resolve syntex::Registry

Output from cargo build

   Compiling etcd v0.5.3
.../build.rs:22:37: 22:50 error: mismatched types:
 expected `&mut syntex::Registry`,
    found `&mut inner::syntex::Registry`
(expected struct `syntex::Registry`,
    found struct `inner::syntex::Registry`) [E0308]
.../build.rs:22             serde_codegen::register(&mut registry);
                                                    ^~~~~~~~~~~~~
.../build.rs:22:37: 22:50 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
error: Could not compile `etcd`.

Support for etcd3

Do you have plans to support etcd v3, and in particular transactions?

Support for managing users, roles

I am building some tooling to not only added keys and directories but also users, roles and grants. This doesn't seem possible with this crate. If I'm wrong, a pointer to how these types of entries can be written as plain nodes would be helpful. Otherwise, an additional module or set of modules to support working these types of data in a cluster would be fantastic.

etcd 2.2

Hi.
Do you support etсd 2.2?

On etcd 2.2 i have error:
panicked at 'called Result::unwrap() on an Err value: ParseError(SyntaxError("trailing characters", 1, 5))', ../src/libcore/result.rs:688

let client = Client::default();
let r = client.get("some_key", true, true);

etcd version - 2.2.3.

Multithread support

v0.7 looks like a good step forward. However, from my point-of-view, the release note misses off one significant change: etcd::Client is no longer Send (or Sync). This means that it is difficult to use in a multithreaded application, even when wrapped in an Mutex.

It appears that making hyper not suitable for multithreading might be deliberate. However, I don't think that needs to be a true of etcd::Client objects. It might even just be a matter of switching from using std::rc::{Rc,Weak} to std::sync::{Arc,Weak}.

Was it a conscious decision not to support multithreading? (If so, why? Performance?) Might you consider doing so?

error[E0277]: the trait bound `std::rc::Weak<std::cell::RefCell<tokio_core::reactor::Inner>>: std::marker::Send` is not satisfied in `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`
  --> src/bin.rs:12:5
   |
12 |     test_send_trait(arc_etcd);
   |     ^^^^^^^^^^^^^^^ `std::rc::Weak<std::cell::RefCell<tokio_core::reactor::Inner>>` cannot be sent between threads safely
   |
   = help: within `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`, the trait `std::marker::Send` is not implemented for `std::rc::Weak<std::cell::RefCell<tokio_core::reactor::Inner>>`
   = note: required because it appears within the type `tokio_core::reactor::Handle`
   = note: required because it appears within the type `hyper::client::Client<hyper::client::connect::HttpConnector>`
   = note: required because it appears within the type `etcd::http::HttpClient<hyper::client::connect::HttpConnector>`
   = note: required because it appears within the type `etcd::Client<hyper::client::connect::HttpConnector>`
   = note: required because it appears within the type `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`
   = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>>`
   = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<std::sync::Mutex<std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>>>`
   = note: required by `test_send_trait`

error[E0277]: the trait bound `std::rc::Rc<std::cell::RefCell<hyper::client::pool::PoolInner<tokio_proto::util::client_proxy::ClientProxy<tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RequestLine>, hyper::http::body::Body>, tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RawStatus>, tokio_proto::streaming::body::Body<hyper::http::chunk::Chunk, hyper::error::Error>>, hyper::error::Error>>>>: std::marker::Send` is not satisfied in `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`
  --> src/bin.rs:12:5
   |
12 |     test_send_trait(arc_etcd);
   |     ^^^^^^^^^^^^^^^ `std::rc::Rc<std::cell::RefCell<hyper::client::pool::PoolInner<tokio_proto::util::client_proxy::ClientProxy<tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RequestLine>, hyper::http::body::Body>, tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RawStatus>, tokio_proto::streaming::body::Body<hyper::http::chunk::Chunk, hyper::error::Error>>, hyper::error::Error>>>>` cannot be sent between threads safely
   |
   = help: within `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::RefCell<hyper::client::pool::PoolInner<tokio_proto::util::client_proxy::ClientProxy<tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RequestLine>, hyper::http::body::Body>, tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RawStatus>, tokio_proto::streaming::body::Body<hyper::http::chunk::Chunk, hyper::error::Error>>, hyper::error::Error>>>>`
   = note: required because it appears within the type `hyper::client::pool::Pool<tokio_proto::util::client_proxy::ClientProxy<tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RequestLine>, hyper::http::body::Body>, tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RawStatus>, tokio_proto::streaming::body::Body<hyper::http::chunk::Chunk, hyper::error::Error>>, hyper::error::Error>>`
   = note: required because it appears within the type `hyper::client::Client<hyper::client::connect::HttpConnector>`
   = note: required because it appears within the type `etcd::http::HttpClient<hyper::client::connect::HttpConnector>`
   = note: required because it appears within the type `etcd::Client<hyper::client::connect::HttpConnector>`
   = note: required because it appears within the type `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`
   = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>>`
   = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<std::sync::Mutex<std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>>>`
   = note: required by `test_send_trait`

0.9.0 does not with tokio 1.x

The demo code from https://docs.rs/etcd/latest/etcd/ does not compile with tokio 1.x
After I managed to make it compile by using futures::compat, at runtime it will give error tokio::spawn failed (is a tokio runtime running this future?).
does the author still plan to make it work with newer version of tokio ?

Relicense under dual MIT/Apache-2.0

This issue was automatically generated. Feel free to close without ceremony if
you do not agree with re-licensing or if it is not possible for other reasons.
Respond to @cmr with any questions or concerns, or pop over to
#rust-offtopic on IRC to discuss.

You're receiving this because someone (perhaps the project maintainer)
published a crates.io package with the license as "MIT" xor "Apache-2.0" and
the repository field pointing here.

TL;DR the Rust ecosystem is largely Apache-2.0. Being available under that
license is good for interoperation. The MIT license as an add-on can be nice
for GPLv2 projects to use your code.

Why?

The MIT license requires reproducing countless copies of the same copyright
header with different names in the copyright field, for every MIT library in
use. The Apache license does not have this drawback. However, this is not the
primary motivation for me creating these issues. The Apache license also has
protections from patent trolls and an explicit contribution licensing clause.
However, the Apache license is incompatible with GPLv2. This is why Rust is
dual-licensed as MIT/Apache (the "primary" license being Apache, MIT only for
GPLv2 compat), and doing so would be wise for this project. This also makes
this crate suitable for inclusion and unrestricted sharing in the Rust
standard distribution and other projects using dual MIT/Apache, such as my
personal ulterior motive, the Robigalia project.

Some ask, "Does this really apply to binary redistributions? Does MIT really
require reproducing the whole thing?" I'm not a lawyer, and I can't give legal
advice, but some Google Android apps include open source attributions using
this interpretation. Others also agree with
it
.
But, again, the copyright notice redistribution is not the primary motivation
for the dual-licensing. It's stronger protections to licensees and better
interoperation with the wider Rust ecosystem.

How?

To do this, get explicit approval from each contributor of copyrightable work
(as not all contributions qualify for copyright, due to not being a "creative
work", e.g. a typo fix) and then add the following to your README:

## License

Licensed under either of

 * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
 * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.

and in your license headers, if you have them, use the following boilerplate
(based on that used in Rust):

// Copyright 2016 rust-etcd developers
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

It's commonly asked whether license headers are required. I'm not comfortable
making an official recommendation either way, but the Apache license
recommends it in their appendix on how to use the license.

Be sure to add the relevant LICENSE-{MIT,APACHE} files. You can copy these
from the Rust repo for a plain-text
version.

And don't forget to update the license metadata in your Cargo.toml to:

license = "MIT/Apache-2.0"

I'll be going through projects which agree to be relicensed and have approval
by the necessary contributors and doing this changes, so feel free to leave
the heavy lifting to me!

Contributor checkoff

To agree to relicensing, comment with :

I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option.

Or, if you're a contributor, you can check the box in this repo next to your
name. My scripts will pick this exact phrase up and check your checkbox, but
I'll come through and manually review this issue later as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.