From a815a8e7cbcb4ebcd05a73a84f7fd2237dd8a44f Mon Sep 17 00:00:00 2001 From: Prashant Varanasi Date: Mon, 25 Jun 2018 16:30:20 -0700 Subject: [PATCH] relay: Rename relay-conn-inactive to relay-client-conn-inactive (#698) This error is emitted if the connection on which we receive a new call is not in a valid state for a call (E.g., client connection is closing, but it sends a new RPC). Make this explicit by prefixing with "relay-client-" rather than "relay-". --- relay.go | 3 ++- relay_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/relay.go b/relay.go index e070db69..24152198 100644 --- a/relay.go +++ b/relay.go @@ -370,8 +370,9 @@ func (r *Relayer) handleCallReq(f lazyCallReq) error { return nil } + // Check that the current connection is in a valid state to handle a new call. if canHandle, state := r.canHandleNewCall(); !canHandle { - call.Failed("relay-conn-inactive") + call.Failed("relay-client-conn-inactive") call.End() err := errConnNotActive{"incoming", state} r.conn.SendSystemError(f.Header.ID, f.Span(), NewWrappedSystemError(ErrCodeDeclined, err)) diff --git a/relay_test.go b/relay_test.go index 2eb766fc..c3324aea 100644 --- a/relay_test.go +++ b/relay_test.go @@ -563,7 +563,7 @@ func TestRelayUsesRootPeers(t *testing.T) { } // Ensure that if the relay recieves a call on a connection that is not active, -// it declines the call, and increments a relay-conn-inactive stat. +// it declines the call, and increments a relay-client-conn-inactive stat. func TestRelayRejectsDuringClose(t *testing.T) { opts := testutils.NewOpts().SetRelayOnly(). AddLogFilter("Failed to relay frame.", 1, "error", "incoming connection is not active: connectionStartClose") @@ -600,7 +600,7 @@ func TestRelayRejectsDuringClose(t *testing.T) { Succeeded().End() calls.Add(client.PeerInfo().ServiceName, ts.ServiceName(), "echo"). // No peer is set since we rejected the call before selecting one. - Failed("relay-conn-inactive").End() + Failed("relay-client-conn-inactive").End() ts.AssertRelayStats(calls) }) }