Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workload/workloadsql: data race in coldata.(*Bytes).Reset() #86545

Closed
cockroach-teamcity opened this issue Aug 22, 2022 · 3 comments · Fixed by #86715
Closed

workload/workloadsql: data race in coldata.(*Bytes).Reset() #86545

cockroach-teamcity opened this issue Aug 22, 2022 · 3 comments · Fixed by #86715
Assignees
Labels
branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. T-sql-queries SQL Queries Team
Milestone

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Aug 22, 2022

workload/workloadsql.TestSplits failed with artifacts on master @ 41c005eb7eb885d2a5b21b01459e121daf5ba18c:

=== RUN   TestSplits/ranges=4

Parameters: TAGS=bazel,gss

Help

See also: How To Investigate a Go Test Failure (internal)

/cc @cockroachdb/sql-experience

This test on roachdash | Improve this report!

Jira issue: CRDB-18807

@cockroach-teamcity cockroach-teamcity added branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. labels Aug 22, 2022
@cockroach-teamcity cockroach-teamcity added this to the 22.2 milestone Aug 22, 2022
@rafiss rafiss changed the title workload/workloadsql: TestSplits failed workload/workloadsql: data race in coldata.(*Bytes).Reset() Aug 23, 2022
@rafiss
Copy link
Collaborator

rafiss commented Aug 23, 2022

There's a data race in coldata.(*Bytes).Reset(). Assigning @cockroachdb/sql-queries since it looks like something in the execution engine.

WARNING: DATA RACE
Write at 0x00c004c90e00 by goroutine 568:
  runtime.slicecopy()
      GOROOT/src/runtime/slice.go:295 +0x0
  github.com/cockroachdb/cockroach/pkg/col/coldata.(*Bytes).Reset()
      github.com/cockroachdb/cockroach/pkg/col/coldata/bytes.go:530 +0x269
  github.com/cockroachdb/cockroach/pkg/col/coldata.ResetIfBytesLike()
      github.com/cockroachdb/cockroach/pkg/col/coldata/bytes.go:599 +0x74
  github.com/cockroachdb/cockroach/pkg/col/coldata.(*MemBatch).ResetInternalBatch()
      github.com/cockroachdb/cockroach/pkg/col/coldata/batch.go:318 +0x3db
  github.com/cockroachdb/cockroach/pkg/sql/colmem.(*Allocator).ResetBatch()
      github.com/cockroachdb/cockroach/pkg/sql/colmem/allocator.go:157 +0x43
  github.com/cockroachdb/cockroach/pkg/sql/colmem.(*Allocator).resetMaybeReallocate()
      github.com/cockroachdb/cockroach/pkg/sql/colmem/allocator.go:219 +0x37b
  github.com/cockroachdb/cockroach/pkg/sql/colmem.(*AccountingHelper).ResetMaybeReallocate()
      github.com/cockroachdb/cockroach/pkg/sql/colmem/allocator.go:647 +0x4cc
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Columnarizer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/columnarizer.go:207 +0x213
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*invariantsChecker).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/invariants_checker.go:93 +0xef
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecsel.(*selLTBytesBytesConstOp).Next()
      github.com/cockroachdb/cockroach/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecsel/selection_ops.eg.go:19367 +0x81
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecsel.(*selGTBytesBytesConstOp).Next()
      github.com/cockroachdb/cockroach/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecsel/selection_ops.eg.go:38379 +0x81
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*defaultBuiltinFuncOperator).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:46 +0x7b
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*rangeStatsOperator).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/range_stats.go:66 +0x7b
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecprojconst.projJSONFetchTextJSONBytesConstOp.Next()
      github.com/cockroachdb/cockroach/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecprojconst/proj_const_right_ops.eg.go:22757 +0x5b
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecprojconst.(*projJSONFetchTextJSONBytesConstOp).Next()
      <autogenerated>:1 +0xe4
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.(*castStringIntOp).Next()
      github.com/cockroachdb/cockroach/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecbase/cast.eg.go:10263 +0x81
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*rangeStatsOperator).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/range_stats.go:66 +0x7b
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecprojconst.projJSONFetchTextJSONBytesConstOp.Next()
      github.com/cockroachdb/cockroach/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecprojconst/proj_const_right_ops.eg.go:22757 +0x5b
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecprojconst.(*projJSONFetchTextJSONBytesConstOp).Next()
      <autogenerated>:1 +0xe4
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.(*castStringIntOp).Next()
      github.com/cockroachdb/cockroach/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecbase/cast.eg.go:10263 +0x81
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj.projPlusInt64Int64Op.Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecproj/proj_non_const_ops.eg.go:4461 +0xa5
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj.(*projPlusInt64Int64Op).Next()
      <autogenerated>:1 +0x105
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*BatchSchemaSubsetEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:205 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*bufferOp).advance()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/buffer.go:48 +0x50
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*caseOp).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/case.go:193 +0x84
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj.projPlusInt64Int64Op.Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecproj/proj_non_const_ops.eg.go:4461 +0xa5
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj.(*projPlusInt64Int64Op).Next()
      <autogenerated>:1 +0x105
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*BatchSchemaSubsetEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:205 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*bufferOp).advance()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/buffer.go:48 +0x50
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*caseOp).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/case.go:193 +0x84
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:138 +0x79
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj.projPlusInt64Int64Op.Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj/bazel-out/k8-dbg/bin/pkg/sql/colexec/colexecproj/proj_non_const_ops.eg.go:4461 +0xa5
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecproj.(*projPlusInt64Int64Op).Next()
      <autogenerated>:1 +0x105
  github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.(*simpleProjectOp).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/simple_project.go:124 +0x81
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*invariantsChecker).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/invariants_checker.go:93 +0xef
  github.com/cockroachdb/cockroach/pkg/sql/colexecop.(*noopOperator).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexecop/operator.go:391 +0x5b
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:303 +0x154
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).nextAdapter()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:328 +0x3a
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).nextAdapter-fm()
      <autogenerated>:1 +0x44
  github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError()
      github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:92 +0xee
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:334 +0x124
  github.com/cockroachdb/cockroach/pkg/sql/rowexec.(*noopProcessor).Next()
      github.com/cockroachdb/cockroach/pkg/sql/rowexec/noop.go:76 +0xe1
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Columnarizer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/columnarizer.go:246 +0x848
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*invariantsChecker).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/invariants_checker.go:93 +0xef
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:303 +0x154
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).nextAdapter()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:328 +0x3a
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).nextAdapter-fm()
      <autogenerated>:1 +0x44
  github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError()
      github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:92 +0xee
  github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:334 +0x124
  github.com/cockroachdb/cockroach/pkg/sql.(*rowSourceToPlanNode).Next()
      github.com/cockroachdb/cockroach/pkg/sql/row_source_to_plan_node.go:76 +0xce
  github.com/cockroachdb/cockroach/pkg/sql.(*bufferNode).Next()
      github.com/cockroachdb/cockroach/pkg/sql/buffer.go:47 +0x19a
  github.com/cockroachdb/cockroach/pkg/sql.(*planNodeToRowSource).Next()
      github.com/cockroachdb/cockroach/pkg/sql/plan_node_to_row_source.go:192 +0x4e5
  github.com/cockroachdb/cockroach/pkg/sql/colflow.(*FlowCoordinator).next()
      github.com/cockroachdb/cockroach/pkg/sql/colflow/flow_coordinator.go:130 +0xe1
  github.com/cockroachdb/cockroach/pkg/sql/colflow.(*FlowCoordinator).nextAdapter()
      github.com/cockroachdb/cockroach/pkg/sql/colflow/flow_coordinator.go:147 +0x58
  github.com/cockroachdb/cockroach/pkg/sql/colflow.(*FlowCoordinator).nextAdapter-fm()
      <autogenerated>:1 +0x44
  github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError()
      github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:92 +0xee
  github.com/cockroachdb/cockroach/pkg/sql/colflow.(*FlowCoordinator).Next()
      github.com/cockroachdb/cockroach/pkg/sql/colflow/flow_coordinator.go:152 +0xf8
  github.com/cockroachdb/cockroach/pkg/sql/execinfra.Run()
      github.com/cockroachdb/cockroach/pkg/sql/execinfra/base.go:186 +0xa1
  github.com/cockroachdb/cockroach/pkg/sql/execinfra.(*ProcessorBaseNoHelper).Run()
      github.com/cockroachdb/cockroach/pkg/sql/execinfra/processorsbase.go:722 +0x165
  github.com/cockroachdb/cockroach/pkg/sql/colflow.(*FlowCoordinator).Run()
      <autogenerated>:1 +0x64
  github.com/cockroachdb/cockroach/pkg/sql/flowinfra.(*FlowBase).Run()
      github.com/cockroachdb/cockroach/pkg/sql/flowinfra/flow.go:472 +0x986
  github.com/cockroachdb/cockroach/pkg/sql/colflow.(*vectorizedFlow).Run()
      github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:307 +0x5b1
  github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).Run()
      github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:695 +0x1cef
  github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).planAndRunSubquery()
      github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:1473 +0x13c4
  github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRunSubqueries()
      github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:1370 +0x31c
  github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRunAll()
      github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:1322 +0x444
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithDistSQLEngine()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1523 +0x1089
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1168 +0x1af7
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:680 +0x6704
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt.func1()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:128 +0x245
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithProfiling()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:2363 +0x7ee
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:127 +0xdeb
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd.func1()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1895 +0x710
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1899 +0x1a84
  github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1821 +0x70e
  github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn()
      github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:814 +0x487
  github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync.func1()
      github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:728 +0xc9c

Previous read at 0x00c004c90e01 by goroutine 555:
  encoding/base64.(*Encoding).Encode()
      GOROOT/src/encoding/base64/base64.go:156 +0x3fa
  encoding/json.encodeByteSlice()
      GOROOT/src/encoding/json/encode.go:846 +0x284
  encoding/json.structEncoder.encode()
      GOROOT/src/encoding/json/encode.go:761 +0x2ba
  encoding/json.structEncoder.encode-fm()
      <autogenerated>:1 +0xdb
  encoding/json.structEncoder.encode()
      GOROOT/src/encoding/json/encode.go:761 +0x2ba
  encoding/json.structEncoder.encode-fm()
      <autogenerated>:1 +0xdb
  encoding/json.ptrEncoder.encode()
      GOROOT/src/encoding/json/encode.go:945 +0x3c2
  encoding/json.ptrEncoder.encode-fm()
      <autogenerated>:1 +0x90
  encoding/json.structEncoder.encode()
      GOROOT/src/encoding/json/encode.go:761 +0x2ba
  encoding/json.structEncoder.encode-fm()
      <autogenerated>:1 +0xdb
  encoding/json.ptrEncoder.encode()
      GOROOT/src/encoding/json/encode.go:945 +0x3c2
  encoding/json.ptrEncoder.encode-fm()
      <autogenerated>:1 +0x90
  encoding/json.(*encodeState).reflectValue()
      GOROOT/src/encoding/json/encode.go:360 +0x88
  encoding/json.interfaceEncoder()
      GOROOT/src/encoding/json/encode.go:716 +0x17b
  encoding/json.structEncoder.encode()
      GOROOT/src/encoding/json/encode.go:761 +0x2ba
  encoding/json.structEncoder.encode-fm()
      <autogenerated>:1 +0xdb
  encoding/json.arrayEncoder.encode()
      GOROOT/src/encoding/json/encode.go:916 +0xc2
  encoding/json.arrayEncoder.encode-fm()
      <autogenerated>:1 +0x90
  encoding/json.sliceEncoder.encode()
      GOROOT/src/encoding/json/encode.go:889 +0x422
  encoding/json.sliceEncoder.encode-fm()
      <autogenerated>:1 +0x90
  encoding/json.structEncoder.encode()
      GOROOT/src/encoding/json/encode.go:761 +0x2ba
  encoding/json.structEncoder.encode-fm()
      <autogenerated>:1 +0xdb
  encoding/json.ptrEncoder.encode()
      GOROOT/src/encoding/json/encode.go:945 +0x3c2
  encoding/json.ptrEncoder.encode-fm()
      <autogenerated>:1 +0x90
  encoding/json.(*encodeState).reflectValue()
      GOROOT/src/encoding/json/encode.go:360 +0x88
  encoding/json.(*encodeState).marshal()
      GOROOT/src/encoding/json/encode.go:332 +0x20b
  encoding/json.(*Encoder).Encode()
      GOROOT/src/encoding/json/stream.go:206 +0xc4
  github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord.GRPCTransportFactory.func1()
      github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord/transport_race.go:123 +0x3f2
  github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2()
      github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:489 +0x4f1

@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Aug 23, 2022
@yuzefovich
Copy link
Member

Oh, it's a new rangeStatsOperator, interesting.

@yuzefovich
Copy link
Member

Well, ok, the problem is that rangeStatsOperator is using the bytes coming from the input batch directly and putting the bytes into KV requests. Then those are bytes in the coldata.Batch are reused on the next iteration, but we are not allowed to modify any bytes that we have put into KV requests previously (due to #75452). I think in this case this GRPCTransportFactory is overly pessimistic as mentioned in Andrei's comment, so there should not be any real problems.

// NOTE(andrei): We don't like this transport very much. It's slow, preventing
// us from running clusters with race binaries and, the way it's written, it
// prevents both the client and the server from mutating the BatchRequest. But
// only the server is prohibited (according to the client.Sender interface). In
// fact, we'd like to have the client reuse these requests and mutate them.
// Instead of this transport, we should find other mechanisms ensuring that:
// a) the server doesn't hold on to any memory, and
// b) the server doesn't mutate the request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants