Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/microsoft/etcd3.git
eb99050058
Fix a race condition in Host.resetAllServices() caused by calling channel.close() as a callback of grpc.Client.waitForReady(). The root cause is gRPC subchannel pool state could become into invalid state when global subchannel pool state is used, and there are multiple channels used the same subchannel from the pool. Closing the channel inside of waitForReady callback prevent all the remaining callbacks for the subchannel from the correct state transition handling. Closing the channel inside of waitForReady callback prevents the subchannel's remaining callbacks from the correct state transition handling. The fix is to use setImmediate to allow the remaining callbacks for the subchannel to process the state transition. |
||
---|---|---|
.github/workflows | ||
.vscode | ||
bin | ||
docs | ||
proto | ||
src | ||
.eslintrc.js | ||
.gitignore | ||
.mocharc.js | ||
.npmignore | ||
LICENSE | ||
SECURITY.md | ||
changelog.md | ||
package-lock.json | ||
package.json | ||
readme.md | ||
tsconfig.json |
readme.md
etcd3
etcd3 is a high-quality, production-ready client for the Protocol Buffer-based etcd v3 API. It includes:
- load balancing
- fault handling and reconnections
- transactions
- software transactional memory
- high-level query builders
- lease management
- watchers
- user and role mocking management
- elections
and is type-safe for TypeScript consumers.
Quickstart
Install via:
npm install --save etcd3
Start building!
const { Etcd3 } = require('etcd3');
const client = new Etcd3();
(async () => {
await client.put('foo').value('bar');
const fooValue = await client.get('foo').string();
console.log('foo was:', fooValue);
const allFValues = await client.getAll().prefix('f').keys();
console.log('all our keys starting with "f":', allFValues);
await client.delete().all();
})();
API Documentation
Our TypeDoc docs are available here.
Our test cases are also readable.
Running tests
$ npm install
$ cd src/test/containers/3.2 && docker-compose up # in a separate shell
$ npm test
$ docker-compose down
Contributing
Running tests for this module requires running an etcd3 server locally. The tests try to use the default port initially, and you can configure this by setting the ETCD_ADDR
environment variable, like export ETCD_ADDR=localhost:12345
.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.