mafintosh / etcdjs Goto Github PK
View Code? Open in Web Editor NEWLow level etcd v2 client written in Javascript with failover support
License: MIT License
Low level etcd v2 client written in Javascript with failover support
License: MIT License
https://github.com/mafintosh/etcdjs/blob/master/index.js#L206
When the default interval logic to refresh the list of machines kicks in, it causes future requests to etcd to break because they will go to an incorrect machine.
This issue surfaced itself because I am running etcd on a boot2docker vm. To access etcd I use the boot2docker IP address. However, the /v2/machines
endpoint for etcd returns http://127.0.0.1:40001
because etcd thinks it is running as localhost only (in the docker container).
I think we should change the default refresh behavior to off and document that by turning refresh on, you need to make sure that your etcd cluster is reporting routable addresses in the v2/machines
endpoint.
This issue is tricky to debug since all you get from nodejs is ECONNRESET and don't realize that it is etcdjs that has now changed the hosts array you originally passed in.
Alternatively, if the user specifies a host or list of hosts we may want to default to off and if they do not, then do the refresh logic. I personally think it is best to turn off the refresh logic as it is a silent killer.
Running the tests against etcd v2.2.0, I get a failed test for the leader function calling /v2/leader
. Investigating it, I don't see that url in the etcd docs. Am I missing something or it just from an older version of etcd? Thanks.
See #8 for context.
Not sure that a good solution exist beyond what is in the PR. The etcd docs talk about how you are suppose to re-fetch the value after missing indices, but when using the wait api in this module, a re-fetch would need to be implemented as a strait update I suppose.
What I described might also be a non-issue. Needs clarification and possible research.
I am working on a service registry module that would use etcd as the backing store. For this module I watch specific keys. One feature I need is the ability to kill/stop waiting on a given key.
I think one way to implement this would be for the .wait
method to return a baton object that would have a function kill
or stop
. Interested in this approach or have a recommendation for a better idea?
cb(null, hosts)
This seems strange to me, probably I am missunderstanding something.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.