open-consul/connect/proxy
Daniel Nephin 03aa6106ff connect/proxy: fix a number of problems with Listener
We noticed that TestUpstreamListener would deadlock sometimes when run
with the race detector. While debugging this issue I found and fixed the
following problems.

1. the net.Listener was not being closed properly when Listener.Stop was
   called. This caused the Listener.Serve goroutine to run forever.
   Fixed by storing a reference to net.Listener and closing it properly
   when Listener.Stop is called.
2. call connWG.Add in the correct place. WaitGroup.Add must be called
   before starting a goroutine, not from inside the goroutine.
3. Set metrics config EnableRuntimeMetrics to `false` so that we don't
   start a background goroutine in each test for no reason. There is no
   way to shutdown this goroutine, and it was an added distraction while
   debugging these timeouts.
5. two tests were calling require.NoError from a goroutine.
   require.NoError calls t.FailNow, which MUST be called from the main
   test goroutine. Instead use t.Errorf, which can be called from other
   goroutines and will still fail the test.
6. `assertCurrentGaugeValue` wass breaking out of a for loop, which
   would cause the `RWMutex.RUnlock` to be missed. Fixed by calling
   unlock before `break`.

The core issue of a deadlock  was fixed by https://github.com/armon/go-metrics/pull/124.
2021-04-28 17:21:35 -04:00
..
config.go Allow passing ALPN next protocols down to connect services. Fixes #4466. (#9920) 2021-03-26 11:34:47 +00:00
config_test.go connect/proxy: remove t.Parallel from tests 2021-04-28 13:46:53 -04:00
conn.go fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
conn_test.go connect/proxy: remove t.Parallel from tests 2021-04-28 13:46:53 -04:00
listener.go connect/proxy: fix a number of problems with Listener 2021-04-28 17:21:35 -04:00
listener_test.go connect/proxy: fix a number of problems with Listener 2021-04-28 17:21:35 -04:00
proxy.go push prometheus sink definiitons into prometheus.PrometheusOpts 2020-11-16 12:44:47 -08:00
proxy_test.go Allow passing ALPN next protocols down to connect services. Fixes #4466. (#9920) 2021-03-26 11:34:47 +00:00
testing.go sdk: add freelist tracking and ephemeral port range skipping to freeport 2019-09-17 14:30:43 -05:00