Commit Graph

17 Commits (5203de5566f4e5e11de299ac9e15bb9ee2c7bcfc)

Author SHA1 Message Date
Shota Fukumori (sora_h) a68efe7d1e proxy: Fix connection leak when client disconnect
established connections were leaked when client disconnected before
proxyreq completes. This happens all time for wait=true requests.
2015-04-30 11:41:42 +09:00
Xiang Li 1b4bcedf99 Merge pull request #2637 from bakins/proxy-randomize-endpoints
proxy: shuffle endpoints
2015-04-07 14:12:50 -07:00
Brian Akins e1622cd22c proxy: shuffle endpoints
Shuffle endpoitns to avoid being "stuck" to a single cluster member.
2015-04-07 15:40:29 -04:00
Alex Crawford d9ad6aa2a9 *: update to use IANA-assigned ports 2015-04-06 13:49:43 -07:00
Jonathan Boulle f1ed69e883 *: switch to line comments for copyright
Build tags are not compatible with block comments.
Also adds copyright header to a few places it was missing.
2015-01-26 09:53:30 -08:00
Xiang Li 424377f859 proxy: add a todo for logging 2014-11-10 16:37:15 -08:00
Xiang Li 6fa8f77638 proxy: return JSON errors 2014-11-10 15:56:42 -08:00
Jonathan Boulle 89eac70d09 proxy: add docstrings 2014-11-05 10:30:05 -08:00
Yicheng Qin aa50af1c69 *: clean log.Print
1. only log things by default that the operator of etcd may need to react to
2. put package name at the head of log lines
2014-10-30 18:15:53 -07:00
Jonathan Boulle 719c57a29d proxy: retrieve ClientURLs from cluster
This is a simple solution to having the proxy keep up to date with the
state of the cluster. Basically, it uses the cluster configuration
provided at start up (i.e. with `-initial-cluster-state`) to determine
where to reach peer(s) in the cluster, and then it will periodically hit
the `/members` endpoint of those peer(s) (using the same mechanism that
`-cluster-state=existing` does to initialise) to update the set of valid
client URLs to proxy to.

This does not address discovery (#1376), and it would probably be better
to update the set of proxyURLs dynamically whenever we fetch the new
state of the cluster; but it needs a bit more thinking to have this done
in a clean way with the proxy interface.

Example in Procfile works again.
2014-10-24 15:54:12 -07:00
Jonathan Boulle 7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
Brian Waldon 73504dca41 proxy: determine scheme based on TLSClientConfig 2014-09-23 11:01:58 -07:00
Brian Waldon 1ea3197feb proxy: pass addrs and scheme into newDirector 2014-09-23 11:01:55 -07:00
Brian Waldon b94d0281d4 etcd: use TLS in proxy transport 2014-09-23 10:19:01 -07:00
Brian Waldon fd1f46313a proxy: add readonly handler 2014-09-18 15:05:30 -07:00
Brian Waldon a155f0bda6 proxy: rewrite stdlib ReverseProxy
The ReverseProxy code from the standard library doesn't actually
give us the control that we want. Pull it down and rip out what
we don't need, adding tests in the process.

All available endpoints are attempted when proxying a request. If a
proxied request fails, the upstream will be considered unavailable
for 5s and no more requests will be proxied to it. After the 5s is
up, the endpoint will be put back to rotation.
2014-09-12 22:56:23 -07:00
Brian Waldon e5a482266f proxy: introduce director
The director class drives an httputil.ReverseProxy. This is used when
etcd is deployed in proxy mode.
2014-09-10 18:04:03 -07:00