58 Commits

Author SHA1 Message Date
Marek Siarkowicz
9606263da0 Return to default write scheduler since golang.org/x/net@v0.11.0 started using round robin
Introduction of round robin 120fc906b3
Added in v0.10.0 https://github.com/golang/net/compare/v0.10.0...v0.11.0

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-17 11:16:51 +02:00
Benjamin Wang
b364b48475 etcdserver: set zap logging to wsproxy
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-04-07 13:38:25 +08:00
Marek Siarkowicz
8dc1244179 server: Add --listen-client-http-urls flag to allow running grpc server separate from http server
Difference in load configuration for watch delay tests show how huge the
impact is. Even with random write scheduler grpc under http
server can only handle 500 KB with 2 seconds delay. On the other hand,
separate grpc server easily hits 10, 100 or even 1000 MB within 100 miliseconds.

Priority write scheduler that was used in most previous releases
is far worse than random one.

Tests configured to only 5 MB to avoid flakes and taking too long to fill
etcd.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-04-03 16:11:03 +02:00
Marek Siarkowicz
dd0bc66478 server: Pick one address that all grpc gateways connect to
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-04-03 15:47:35 +02:00
Marek Siarkowicz
66704b4c59 server: Separate client listener grouping from serving
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-04-03 15:43:35 +02:00
Wei Fu
303519c7b8 server/embed: fix data race when start insecure grpc
There are two goroutines accessing the `gs` grpc server var. Before
insecure `gs` server start, the `gs` can be changed to secure server and
then the client will fail to connect to etcd with insecure request. It
is data-race. We should use argument for reference in the new goroutine.

fix: #15495

Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit a9988e2625eede1af81d189b5f2ecf7d4af3edf1)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-20 21:33:16 +08:00
Marek Siarkowicz
60e381aaa9 server: Switch back to random scheduler to improve resilience to watch starvation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-14 10:33:15 +01:00
Benjamin Wang
6071b1c523 Support configuring MaxConcurrentStreams for http2
Backport https://github.com/etcd-io/etcd/pull/14219 to 3.4

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-07-21 14:25:29 +08:00
spacewander
628fa1818e embed: unlimit the recv msg size of grpc-gateway
Ensure the client which access etcd via grpc-gateway won't
be limited by the MaxCallRecvMsgSize. Here we choose the same
default value of etcdcli as grpc-gateway's MaxCallRecvMsgSize.

Fix https://github.com/etcd-io/etcd/issues/12576
2021-06-11 08:07:28 +08:00
Vitaliy Filippov
a40f14d92c etcdserver: Fix 64 KB websocket notification message limit
This fixes etcd being unable to send any message longer than 64 KB as
a notification over the websocket. This was because the older version
of grpc-websocket-proxy was used and WithMaxRespBodyBufferSize option
wasn't set.
2021-01-30 00:37:02 +03:00
Gyuho Lee
8b053b0f44 embed: fix secure server logging message
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-09-03 09:43:08 -07:00
Gyuho Lee
a6b105a907 embed: use new "credentials" package
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-26 08:56:45 -07:00
Gyuho Lee
34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
shivaramr
9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
Hitoshi Mitake
11fb62ecb4 embed: requests for grpc gateway must have empty CN if --client-cert-auth is passed
This commit lets grpc gateway return a correct error to clients.

Even if a client has a cert with non empty CN, current gateway returns
an error like below:
```
$ curl --cacert ./integration/fixtures/ca.crt --cert ./integration/fixtures/server.crt --key ./integration/fixtures/server.key.insecure https://localhost:2379/v3/kv/put -X POST -d '{"key": "fromcurl", "value": "test"}'
{"error":"etcdserver: user name is empty","code":3}
```
This is because etcd ignores CN from gateway connection.

The error will be like this:
```
$ curl --cacert ./integration/fixtures/ca.crt --cert ./integration/fixtures/server.crt --key ./integration/fixtures/server.key.insecure https://localhost:2379/v3/kv/put -X POST -d '{"key": "fromcurl", "value": "test"}'
CommonName of client sending a request against gateway will be ignored and not used as expected
```

The error will be returned if the server is enabling auth and gRPC
gateway.
2019-01-23 03:26:34 +09:00
Hitoshi Mitake
72dd4a18c5 *: add a new option --enable-grpc-gateway for enabling/disabling grpc gateway 2019-01-23 03:26:34 +09:00
Gyuho Lee
c58f5cfeda test: disable "unparam" for now
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-12-17 11:30:28 -08:00
Gyuho Lee
d37f1521b7 *: update import paths to "go.etcd.io/etcd"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Gyuho Lee
1ebaeed5c1 embed: fix typo
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-25 11:15:47 -07:00
Gyuho Lee
b0112086d6
Merge pull request #9354 from hexfusion/u_sock
embed: explicitly define unix proto
2018-04-19 08:16:38 -07:00
Gyuho Lee
a47c18ff5b embed: clean up initial server start logs
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-17 14:24:08 -07:00
Gyuho Lee
041b9069a2 *: configure server logger
- Add/Document "logger" to support structured logging.
  - This makes functional tests run easier, since zap logger
    provides built-in log redirect to files.
  - "etcd --logger-option=zap" to enable structured logging.
- Current "capnslog" will still be used as "default".
  - We may switch the default or deprecate "capnslog" in v3.5.
  - Either way, will clearly be documented.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-16 17:36:00 -07:00
Sam Batschelet
2e4f856389 embed: explicitly define unix network 2018-04-15 16:30:44 -04:00
Gyuho Lee
9ea8be0c2b embed: support "CORS" handler in v3 HTTP requests
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-27 06:25:44 -07:00
Gyuho Lee
8edaecadc4 embed: enforce client origin policy
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-28 18:27:22 -08:00
Gyuho Lee
f6617feb8a embed: rename "httpWrapper"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-28 11:15:10 -08:00
Gyuho Lee
c4fb5bdd23 embed: rename "v3alphaMutator" to "v3Mutator"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-27 14:31:32 -08:00
Sam Batschelet
488ee99ae8 *: replace grpc-gateway endpoint with stable /v3 2018-02-11 19:07:36 -05:00
Gyuho Lee
9744e1ee87 embed: stop *grpc.Server on *serveCtx serve error
If serve errors before *grpc.Server is sent to serversC,
it should be closed manually.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-08 18:50:37 -08:00
Gyuho Lee
552b58dcfb embed: only gracefully shutdown insecure grpc.Server
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-07 20:36:31 -08:00
James Phillips
e39915feec embed: Avoid panic when shutting down gRPC Server
Avoid panic when stopping gRPC Server if TLS configuration is present.
Provided solution (attempts to) implement suggestion from gRPC team: https://github.com/grpc/grpc-go/issues/1384#issuecomment-317124531.

Fixes #8916
2017-12-07 20:36:31 -08:00
Gyu-Ho Lee
c706c6e238 embed: mutate /v3alpha requests with /v3beta for backward compatibilities
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-15 02:14:04 -08:00
Gyu-Ho Lee
5fd419ff50 embed: replace v3alpha serve path with v3beta
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-15 01:55:49 -08:00
Iwasaki Yudai
37eabd770e embed: support websocket for bi-directional streams 2017-10-05 16:08:18 -07:00
Gyu-Ho Lee
157c8eccf0 embed: define keepalive server options
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-28 11:19:29 -07:00
Gyu-Ho Lee
f65aee0759 *: replace 'golang.org/x/net/context' with 'context'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-07 13:39:42 -07:00
Anthony Romano
35c5dcefc2 *: cockroachdb/cmux -> soheilhy/cmux
Has fixes not in fork. Includes SetReadTimeout.
2017-08-22 09:59:59 -07:00
Anthony Romano
63350f5ac1 embed: connect json gateway with user-provided listen address
net.Listener says its address is [::] when given 0.0.0.0, breaking
hosts that have ipv6 disabled.

Fixes #8151
Fixes #7961
2017-07-06 14:24:29 -07:00
Anthony Romano
87d16af2e2 embed: use transport TLS listener for client listener for CRLs 2017-06-19 15:23:41 -07:00
Anthony Romano
db7ab961bf embed: share grpc connection for grpc json services 2017-05-22 12:59:13 -07:00
Gyu-Ho Lee
7d21d6c894 embed: gracefully close peer handlers on shutdown
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-05-06 07:47:23 -07:00
Anthony Romano
393e4335b7 *: put gateway stubs into their own packages
Fixes #7773
2017-04-19 13:09:06 -07:00
Gyu-Ho Lee
ba299bcaaf embed: signal 'grpcServerC' before cmux serve
CMux.Serve blocks, so grpcServerC was never closed.

Fix https://github.com/coreos/etcdlabs/issues/216.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-18 17:49:50 -07:00
Gyu-Ho Lee
8aaa1ed911 *: use '*tls.Config.Clone' in Go 1.8
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-17 20:08:27 -07:00
Gyu-Ho Lee
c407e097e2 embed: gracefully shut down gRPC server
Fix https://github.com/coreos/etcd/issues/7322.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-17 14:12:40 -07:00
Anthony Romano
93594006df embed: register grpc-gateway endpoints for v3lock and v3election 2017-04-10 15:21:07 -07:00
Anthony Romano
78422eaa17 embed: add Election service 2017-04-07 16:36:38 -07:00
Xiang
fd5984af56 *: add pprof flag to grpc proxy 2017-04-03 22:07:17 -07:00
fanmin shi
f292a4c953 embed: don't return error when closing on embed etcd
FIXES #7019
2017-03-17 13:41:05 -07:00
Anthony Romano
ad1a790116 embed: serve lock api 2017-03-13 15:23:26 -07:00