Gyu-Ho Lee
7b5657cf1a
clientv3: check if KV.Client is closed
...
For https://github.com/coreos/etcd/issues/5495 .
2016-05-31 12:00:19 -07:00
Gyu-Ho Lee
d116c116fe
clientv3: getRemote comment about release
2016-05-31 12:00:19 -07:00
Gyu-Ho Lee
9a0fe2620e
clientv3: fix panic message in OpPut
2016-05-28 11:55:28 -07:00
Anthony Romano
9dc0782f45
clientv3: handle URL scheme when given in endpoint
...
Fixes #5427
2016-05-25 18:01:36 -06:00
James Shubin
374b3ee40b
clientv3: fix typo
2016-05-20 17:18:52 -04:00
James Shubin
edca3cbe44
clientv3: Fix typos
...
Found randomly when going through docs. HTH
2016-05-20 14:06:29 -04:00
Gyu-Ho Lee
fa1e40c120
clientv3/concurrency: preallocate slice in stm
2016-05-19 14:42:19 -07:00
Gyu-Ho Lee
f9306fb817
clientv3: preallocate watch streams slice
...
To avoid slice growth when appending
2016-05-19 12:55:55 -07:00
Anthony Romano
e4a2dcad9e
clientv3/integration: ignore closing transport in TestKVPutStoppedServerAndClose
...
The grpc "transport is closing" error is rasied when the host is unreachable;
there's no good way to avoid it for a Put.
Fixes #5343
2016-05-18 14:49:39 -07:00
Anthony Romano
782a8802c0
clientv3: avoid reusing closed connection in KV
2016-05-18 14:46:17 -07:00
Gyu-Ho Lee
86c85b88ad
Merge pull request #5377 from purpleidea/bug/typos
...
clientv3: fix typos
2016-05-17 12:51:13 -07:00
James Shubin
42f3b4964f
clientv3: fix typos
2016-05-17 15:39:56 -04:00
Hitoshi Mitake
6259318521
*: attach auth token as a gRPC credential
...
This commit adds a functionality of attaching an auth token to gRPC
connection as a per RPC credential.
For doing this, this commit lets clientv3.Client.Dial() create a
dedicated gRPC connection for doing authentication. With the dedicated
connection, the client calls Authenticate() RPC and obtain its
token. The token is attached to the main gRPC connection with
grpc.WithPerRPCCredentials().
This commit also adds a new option --username to etcdctl (v3). With
this option, etcdctl attaches its auth token to the main gRPC
connection (currently it is not used at all).
2016-05-17 13:26:12 +09:00
Anthony Romano
e8101ddf09
clientv3: throttle reconnection rate
...
Client was reconnecting after establishing connections because the lease
and watch APIs were thrashing. Instead, wait a little before accepting
new reconnect requests.
2016-05-16 11:14:45 -07:00
Xiang Li
ec2ac72585
proxy: initial grpc kv service proxy
2016-05-13 23:00:29 -07:00
Xiang Li
c7c0e1eb7a
integration: remove parallel testing
...
We cannot do testing in parallel since leak testing will detect the goroutines
in other tests running in parallel.
2016-05-13 12:01:25 -07:00
Anthony Romano
120020fa9c
clientv3/concurrency: use session id for election keys to avoid deadlock
2016-05-13 10:07:35 -07:00
Anthony Romano
393725fe5f
clientv3/concurrency: ctx-ize Leader(), Resign(), and Unlock()
2016-05-13 10:07:35 -07:00
Gyu-Ho Lee
fd9e07a529
clientv3: update LICENSE header
2016-05-12 20:50:58 -07:00
Gyu-Ho Lee
68eaf4083a
clientv3: WithRequireLeader
2016-05-12 19:25:42 -07:00
Anthony Romano
527aa1a499
clientv3: fix Close after failed Put
...
Was crashing on a nil connection. Reworked the shutdown path a little so
there's only one connection close site.
2016-05-12 16:16:27 -07:00
Xiang Li
0d43a2b7e7
Merge pull request #5295 from ajityagaty/auth_disable
...
auth: Adding support for "auth disable" command.
2016-05-07 23:09:37 -07:00
Ajit Yagaty
adc981c53d
auth: Adding support for "auth disable" command.
...
Added support for the auth disable command in the server, added the
etcdctl command and a respective testcase.
2016-05-07 19:21:49 -07:00
Anthony Romano
712090fc09
clientv3: keep watcher client active if reconnect has network error
...
Otherwise watchers created after a long disconnect period will always
close immediately.
2016-05-05 19:30:11 -07:00
Anthony Romano
22c3a439bc
clientv3: do not stop lease client on lost receive stream
...
Fixes #5242
2016-05-05 19:30:11 -07:00
Anthony Romano
cdc8f99658
clientv3: rework reconnection logic
...
Avoids go routine flood for tight loops with a dead connection.
Now uses request ctx when reconnecting for immediate retry.
2016-05-05 19:30:11 -07:00
Anthony Romano
8b52fd0d2d
clientv3: gracefully handle watcher resume on compacted revision
...
Fixes #5239
2016-05-03 09:30:53 -07:00
Gyu-Ho Lee
0c5bcd5d80
clientv3: fix README, add error handling example
2016-04-29 13:34:16 -07:00
Gyu-Ho Lee
b3ebe66c97
clientv3/integration: tests with new errors
2016-04-29 12:00:26 -07:00
Gyu-Ho Lee
6049c95dc9
clientv3: auth with rpctypes.Error
2016-04-29 12:00:26 -07:00
Anthony Romano
c26eb3f241
clientv3: better serialization for kv and txn connection retry
...
If the grpc connection is restored between an rpc network failure
and trying to reestablish the connection, the connection retry would
end up resetting good connections if many operations were
in-flight at the time of network failure.
2016-04-29 09:26:32 -07:00
Gyu-Ho Lee
f148f4b2b9
clientv3/integration: tests error types (rpctypes)
2016-04-28 15:42:27 -07:00
Gyu-Ho Lee
2e3d79a7bf
clientv3: convert errors to rpctypes on returning
...
For https://github.com/coreos/etcd/issues/5211 .
2016-04-28 15:39:37 -07:00
Anthony Romano
08f6c0775a
Merge pull request #5199 from heyitsanthony/safe-lock-retry
...
clientv3/concurrency: use session lease id for mutex keys
2016-04-27 11:10:46 -07:00
Anthony Romano
ecb0e2bd38
Merge pull request #5203 from heyitsanthony/fix-lease-leak
...
clientv3: check stream context in lease keep alive send loop
2016-04-26 20:42:31 -07:00
Anthony Romano
30a9229f38
clientv3: check stream context in lease keep alive send loop
...
If no leases are being kept alive, a connection reset would leak
the send routine since it would only test the stream when sending
keep alives.
Fixes #5200
2016-04-26 20:10:09 -07:00
Anthony Romano
22797c7185
clientv3/concurrency: use session lease id for mutex keys
...
With randomized keys, if the connection goes down, but the session remains,
the client would need complicated recovery logic to avoid deadlock.
Instead, bind the session's lease id to the lock entry; if a session tries
to reacquire the lock it will reassume its old place in the wait list.
2016-04-26 17:37:26 -07:00
Anthony Romano
af1a0b60e2
etcdserver: respond with ttl=0 for revoked lease keep alive
...
Fixes #5172
2016-04-26 13:53:20 -07:00
Anthony Romano
b7ac758969
*: rename storage package to mvcc
2016-04-25 15:25:51 -07:00
Xiang Li
9ec176a9b0
Merge pull request #5176 from xiang90/lease_client
...
clientv3: keepaliveonce should have a per call ctx
2016-04-25 11:45:58 -07:00
Xiang Li
cbd79c666e
clientv3: keepaliveonce should have a per call ctx
...
KeepAliveOnce should have a per call ctx. Now we have a per
API ctx, but we might do rpc calls mutiple times in a for loop.
To avoid unnecessary routine leak, use per call ctx.
2016-04-25 10:46:47 -07:00
Xiang Li
844208d7dd
clientv3: retry on switchRemoteAndStream
...
If switchRemoteAndStream fails, the whole lease API fails since
the internal routine exits. We should only fail the whole API when
there is a fatal error. For example, we should fail if we fail to
connection to all the endpoints user provided.
If we connect to an endpoint, but fail to create a stream, we should
retry instead of returning error to fail the entire API.
2016-04-23 21:55:34 -07:00
Hitoshi Mitake
131e3806bb
*: support authenticate in v3 auth
...
This commit implements Authenticate() API of the auth package. It does
authentication based on its authUsers bucket and generate a token for
succeeding RPCs.
2016-04-21 12:32:19 +09:00
Ajit Yagaty
da5bd04a1a
clientv3: Remove superflous LeaseID casts in integration tests.
...
The integration tests under clientv3 have superflous LeaseID casts
that are not needed as the ID field of the lease responses are of
type LeaseID now.
2016-04-15 17:48:20 -07:00
Anthony Romano
9bfa0172f5
test, clientv3: run examples as integration tests
2016-04-15 11:51:30 -07:00
Anthony Romano
c1455a4f10
Merge pull request #5090 from ajityagaty/lease_id
...
clientv3: Use LeaseID in all the client APIs.
2016-04-15 10:48:29 -07:00
Gyu-Ho Lee
ae27b991b1
*: add more examples to clientv3, pkg/adt
2016-04-14 23:46:50 -07:00
Ajit Yagaty
06a4086bf9
clientv3: Use LeaseID in all the client APIs.
...
In order to use LeaseID type instead of int64 we have to convert
the protobuf lease responses into client lease reponses.
2016-04-14 23:09:46 -07:00
Anthony Romano
57448622d9
Merge pull request #5085 from heyitsanthony/hide-yaml
...
clientv3: make YamlConfig struct private
2016-04-14 14:10:20 -07:00
Anthony Romano
04ef861c3d
clientv3: make YamlConfig struct private
2016-04-14 12:26:01 -07:00