Skip to content

Commit fd967e0

Browse files
committed
Remove LatencyAccept of the reverse proxy from the e2e test
Part of the patches to fix #17737 During the development of #17938, we agreed that during the transition to L7 forward proxy, unused features and features targeting L4 reverse proxy will be dropped. This feature falls under the unused feature. Also, the initial implementation has a bug: if connections are not created continuously, the latency accept will not work. Consider the following case: a) set latency accept b) put latency accept into effect c) latency accept will start idling the goroutine d) block-wait at accept() - waiting for new connections e) new connection comes in - establish it f) go to c -> as we can see, if the request come every x seconds, where x is larger than the latency accept time we set, we can see that the latency accept has no effect. Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
1 parent 925181a commit fd967e0

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

pkg/proxy/server.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ type Server interface {
5959
// Close closes listener and transport.
6060
Close() error
6161

62-
LatencyAccept() time.Duration
63-
6462
// DelayTx adds latency ± random variable for "outgoing" traffic
6563
// in "sending" layer.
6664
DelayTx(latency, rv time.Duration)
@@ -142,9 +140,6 @@ type server struct {
142140
listenerMu sync.RWMutex
143141
listener net.Listener
144142

145-
latencyAcceptMu sync.RWMutex
146-
latencyAccept time.Duration
147-
148143
modifyTxMu sync.RWMutex
149144
modifyTx func(data []byte) []byte
150145

@@ -263,17 +258,6 @@ func (s *server) listenAndServe() {
263258
close(s.readyc)
264259

265260
for {
266-
s.latencyAcceptMu.RLock()
267-
lat := s.latencyAccept
268-
s.latencyAcceptMu.RUnlock()
269-
if lat > 0 {
270-
select {
271-
case <-time.After(lat):
272-
case <-s.donec:
273-
return
274-
}
275-
}
276-
277261
s.listenerMu.RLock()
278262
ln := s.listener
279263
s.listenerMu.RUnlock()
@@ -609,13 +593,6 @@ func (s *server) Close() (err error) {
609593
return err
610594
}
611595

612-
func (s *server) LatencyAccept() time.Duration {
613-
s.latencyAcceptMu.RLock()
614-
d := s.latencyAccept
615-
s.latencyAcceptMu.RUnlock()
616-
return d
617-
}
618-
619596
func (s *server) DelayTx(latency, rv time.Duration) {
620597
if latency <= 0 {
621598
return

0 commit comments

Comments
 (0)