From a548eba31b7be48f49d424dfe85f0959ac11e598 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Tue, 12 Mar 2019 16:03:15 -0400 Subject: [PATCH] kv: disable size check on marshaling to reduce panics This disables a portion of the additional checking added in #35202 because it increases the rate of panics. This case should be re-enabled with the complete resolution of #34241. Release note: None --- pkg/kv/transport.go | 6 +++++- pkg/kv/transport_test.go | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/kv/transport.go b/pkg/kv/transport.go index 9b095859bfb1..0db536ebfe8e 100644 --- a/pkg/kv/transport.go +++ b/pkg/kv/transport.go @@ -159,8 +159,12 @@ func (gt *grpcTransport) maybeResurrectRetryablesLocked() bool { func withMarshalingDebugging(ctx context.Context, ba roachpb.BatchRequest, f func()) { nPre := ba.Size() defer func() { + // TODO(ajwerner): re-enable the pre-emptive panic case below when the sizes + // do not match. The case is being disabled temporarily to reduce the + // rate of panics in the upcoming release. A more holistic fix which + // eliminates the shallow copies of transactions is coming soon. nPost := ba.Size() - if r := recover(); r != nil || nPre != nPost { + if r := recover(); r != nil /* || nPre != nPost */ { var buf strings.Builder _, _ = fmt.Fprintf(&buf, "batch size %d -> %d bytes\n", nPre, nPost) func() { diff --git a/pkg/kv/transport_test.go b/pkg/kv/transport_test.go index d860988fe09b..259efafa5e15 100644 --- a/pkg/kv/transport_test.go +++ b/pkg/kv/transport_test.go @@ -176,6 +176,7 @@ func (m *mockInternalClient) RangeFeed( func TestWithMarshalingDebugging(t *testing.T) { defer leaktest.AfterTest(t)() + t.Skip(fmt.Sprintf("Skipped until #34241 is resolved")) ctx := context.Background()