featurebase/server
Seebs 4f5f3e30ea remove port_mapper because it can't work with our unrestartable server
Long story short: Once we create a server and start it, we can't start
it again. We can't close it and restart it, and we can't just start
it without closing it.

Unfortunately, if the server's config needs to change, we have a Problem
here.

This ultimately means that the retry logic for GetListeners can't actually
retry successfully; if we fail on the first attempt, we necessarily fail
on any later attempts also, and if we try to fix that, we get panics.

But!

We don't actually NEED to retry. We just need to ensure that we can
open a :0 port, extract the actual port number, and use that in places
where the port number mattered, without having to rebind it.

The only actual place we needed to rebind things was opening gRPC
servers, so we introduce a gRPC Listener that can be used instead of
trying to bind to a specified port.

In a bunch of other cases where we had similar logic to try to allocate
and then use a port, we can switch to just using a provided listener.
For instance, net/http has `Serve(net.Listener, handler)`, not just
ListenAndServe(addr, handler).

This should eliminate the weird CI failures from eaddrinuse.

NOT fixed: server/cluster_test.go/TestClusterResize_AddNode isn't working
right now. The new node isn't actually being added to the existing cluster.
I attempted this but was outsmarted by it, and I think fixing the
rest of this is worth it as a separate thing.
2021-02-24 11:25:46 -06:00
..
testdata/certs Supply "subject alternative name" for TLS certificates 2020-10-20 14:14:26 -05:00
cluster_test.go remove port_mapper because it can't work with our unrestartable server 2021-02-24 11:25:46 -06:00
config.go remove port_mapper because it can't work with our unrestartable server 2021-02-24 11:25:46 -06:00
config_internal_test.go add --advertise-grpc configuration option 2020-07-09 11:17:12 -05:00
config_test.go update config to support etcd arguments 2021-01-29 19:43:48 -06:00
default.go Unexport server.DefaultDiagnosticsInterval 2018-07-05 23:11:56 -05:00
dup.go Reduce duplication of setupLogger arch-specific code 2020-04-16 17:08:50 -05:00
dup_arm64.go Reduce duplication of setupLogger arch-specific code 2020-04-16 17:08:50 -05:00
grpc.go Change coordinator error to primary 2021-02-23 09:58:22 +01:00
grpc_test.go Fix TestCRUDIndexes 2021-02-10 16:22:34 +01:00
handler_test.go fix SchemaDetails test 2021-02-12 21:11:45 -06:00
pg.go handling aggregate types: add to protobuf, etc 2021-01-19 16:23:15 -06:00
pg_test.go handling aggregate types: add to protobuf, etc 2021-01-19 16:23:15 -06:00
release.go Unexport server.DefaultDiagnosticsInterval (in release tag) 2018-07-05 23:11:57 -05:00
server.go remove port_mapper because it can't work with our unrestartable server 2021-02-24 11:25:46 -06:00
server_test.go remove port_mapper because it can't work with our unrestartable server 2021-02-24 11:25:46 -06:00
sql.go fix SQL memory leak 2020-08-31 13:10:49 -04:00
tlsconfig.go test and fix authentication of client certs btwn cluster nodes 2019-10-18 15:17:35 -05:00
trial.go clarify purpose of trialVersion by changing the name to handleTrialDeadline and adding a doc string 2021-02-11 16:13:04 -06:00