This commit changes the timeout for `mux.Mux.handleConn()` to use
`time.Timer` instead of `time.After()` so that the channel can be
closed immediately once the connection is handed off.
If the mux listener gets a invalid request, log the IP address of the
client to help users track down the issue.
Since the listener is started before the services that use it are ready,
it can receive requests and block indefinitely waiting for the handler
channel to receive. If the channel is blocked, all the channel send
to timeout to prevent clients form accruing blocked connnecitons.
* Add dir, hostname, and bind address to top level config since it applies to services other than meta
* Add enabled flags to example toml for data and meta services
* Wire up add/remove raft peers and meta servers to meta service
* Update DROP SERVER to be either DROP META SERVER or DROP DATA SERVER
* Bring over statement executor from old meta package
* Start meta service client implementation
* Update meta service test to use the client
* Wire up node ID/meta server storage information
The mux listener was handling connections and demux serially. This could cause
issues if one handler was slow or blocked. For example, if a node had many
hinted handed writes queued for a down node, when the down node was started, it
would start handling the write requests (possibly before it had synchronized with
the cluster). This would cause the connectiosn to block and also prevent the cluster
synchronization from occuring because they both use the same mux listener.
Fixes#3960
This commit adds tcp.Mux which multiplexes connections over TCP using
the first byte as the header byte. Users can listen to the muxer
using mux.Listen(hdr) and obtain a net.Listener.