From e3d7099674676ab292618155e8f11f253746b0f1 Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Tue, 7 Sep 2021 14:49:06 +0300 Subject: [PATCH 1/3] Support graceful shutdown in grpc plugin Signed-off-by: Fedor Korotkiy --- Makefile | 1 + plugin/storage/grpc/proto/storage.proto | 9 + plugin/storage/grpc/shared/grpc_client.go | 14 + .../storage/grpc/shared/grpc_client_test.go | 19 + plugin/storage/grpc/shared/grpc_server.go | 11 + .../mocks/DependenciesReaderPluginClient.go | 13 +- .../mocks/DependenciesReaderPluginServer.go | 9 +- .../mocks/SpanReaderPluginClient.go | 13 +- .../mocks/SpanReaderPluginServer.go | 9 +- .../SpanReaderPlugin_FindTracesClient.go | 12 +- .../SpanReaderPlugin_FindTracesServer.go | 12 +- .../mocks/SpanReaderPlugin_GetTraceClient.go | 12 +- .../mocks/SpanReaderPlugin_GetTraceServer.go | 12 +- .../mocks/SpanWriterPluginClient.go | 43 +- .../mocks/SpanWriterPluginServer.go | 32 +- proto-gen/storage_v1/storage.pb.go | 460 +++++++++++++++--- 16 files changed, 564 insertions(+), 117 deletions(-) diff --git a/Makefile b/Makefile index 003f39d7b68..bbf743d7cd6 100644 --- a/Makefile +++ b/Makefile @@ -415,6 +415,7 @@ install-mockery: generate-mocks: install-mockery $(MOCKERY) -all -dir ./pkg/es/ -output ./pkg/es/mocks && rm pkg/es/mocks/ClientBuilder.go $(MOCKERY) -all -dir ./storage/spanstore/ -output ./storage/spanstore/mocks + $(MOCKERY) -all -dir ./proto-gen/storage_v1/ -output ./proto-gen/storage_v1/mocks .PHONY: echo-version echo-version: diff --git a/plugin/storage/grpc/proto/storage.proto b/plugin/storage/grpc/proto/storage.proto index a3e5eb9c31d..38c9df5b78c 100644 --- a/plugin/storage/grpc/proto/storage.proto +++ b/plugin/storage/grpc/proto/storage.proto @@ -58,6 +58,14 @@ message WriteSpanResponse { } +// empty; extensible in the future +message CloseWriterRequest { +} + +// empty; extensible in the future +message CloseWriterResponse { +} + message GetTraceRequest { bytes trace_id = 1 [ (gogoproto.nullable) = false, @@ -135,6 +143,7 @@ message FindTraceIDsResponse { service SpanWriterPlugin { // spanstore/Writer rpc WriteSpan(WriteSpanRequest) returns (WriteSpanResponse); + rpc Close(CloseWriterRequest) returns (CloseWriterResponse); } service SpanReaderPlugin { diff --git a/plugin/storage/grpc/shared/grpc_client.go b/plugin/storage/grpc/shared/grpc_client.go index f8342847044..d5a0d905e2e 100644 --- a/plugin/storage/grpc/shared/grpc_client.go +++ b/plugin/storage/grpc/shared/grpc_client.go @@ -222,7 +222,21 @@ func (c *grpcClient) WriteSpan(ctx context.Context, span *model.Span) error { _, err := c.writerClient.WriteSpan(ctx, &storage_v1.WriteSpanRequest{ Span: span, }) + + if err != nil { + return fmt.Errorf("plugin error: %w", err) + } + + return nil +} + +func (c *grpcClient) Close() error { + _, err := c.writerClient.Close(context.Background(), &storage_v1.CloseWriterRequest{}) if err != nil { + if status.Code(err) == codes.Unimplemented { + return nil + } + return fmt.Errorf("plugin error: %w", err) } diff --git a/plugin/storage/grpc/shared/grpc_client_test.go b/plugin/storage/grpc/shared/grpc_client_test.go index 872968a68c5..b77536542ed 100644 --- a/plugin/storage/grpc/shared/grpc_client_test.go +++ b/plugin/storage/grpc/shared/grpc_client_test.go @@ -298,6 +298,25 @@ func TestGRPCClientWriteSpan(t *testing.T) { }) } +func TestGRPCClientCloseWriter(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.spanWriter.On("Close", mock.Anything, &storage_v1.CloseWriterRequest{}).Return(&storage_v1.CloseWriterResponse{}, nil) + + err := r.client.Close() + assert.NoError(t, err) + }) +} + +func TestGRPCClientCloseNotSupported(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.spanWriter.On("Close", mock.Anything, &storage_v1.CloseWriterRequest{}).Return( + nil, status.Errorf(codes.Unimplemented, "method not implemented")) + + err := r.client.Close() + assert.NoError(t, err) + }) +} + func TestGRPCClientGetDependencies(t *testing.T) { withGRPCClient(func(r *grpcClientTest) { lookback := time.Duration(1 * time.Second) diff --git a/plugin/storage/grpc/shared/grpc_server.go b/plugin/storage/grpc/shared/grpc_server.go index 488a17bf692..bed633fe820 100644 --- a/plugin/storage/grpc/shared/grpc_server.go +++ b/plugin/storage/grpc/shared/grpc_server.go @@ -17,6 +17,7 @@ package shared import ( "context" "fmt" + "io" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -54,6 +55,16 @@ func (s *grpcServer) WriteSpan(ctx context.Context, r *storage_v1.WriteSpanReque return &storage_v1.WriteSpanResponse{}, nil } +func (s *grpcServer) Close(ctx context.Context, r *storage_v1.CloseWriterRequest) (*storage_v1.CloseWriterResponse, error) { + if closer, ok := s.Impl.SpanWriter().(io.Closer); ok { + if err := closer.Close(); err != nil { + return nil, err + } + } + + return &storage_v1.CloseWriterResponse{}, nil +} + // GetTrace takes a traceID and streams a Trace associated with that traceID func (s *grpcServer) GetTrace(r *storage_v1.GetTraceRequest, stream storage_v1.SpanReaderPlugin_GetTraceServer) error { trace, err := s.Impl.SpanReader().GetTrace(stream.Context(), r.TraceID) diff --git a/proto-gen/storage_v1/mocks/DependenciesReaderPluginClient.go b/proto-gen/storage_v1/mocks/DependenciesReaderPluginClient.go index ba05531c915..c5534f1aaea 100644 --- a/proto-gen/storage_v1/mocks/DependenciesReaderPluginClient.go +++ b/proto-gen/storage_v1/mocks/DependenciesReaderPluginClient.go @@ -2,10 +2,15 @@ package mocks -import context "context" -import grpc "google.golang.org/grpc" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) // DependenciesReaderPluginClient is an autogenerated mock type for the DependenciesReaderPluginClient type type DependenciesReaderPluginClient struct { diff --git a/proto-gen/storage_v1/mocks/DependenciesReaderPluginServer.go b/proto-gen/storage_v1/mocks/DependenciesReaderPluginServer.go index 7d126aeeada..52b1caf2a80 100644 --- a/proto-gen/storage_v1/mocks/DependenciesReaderPluginServer.go +++ b/proto-gen/storage_v1/mocks/DependenciesReaderPluginServer.go @@ -2,9 +2,12 @@ package mocks -import context "context" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" + mock "github.com/stretchr/testify/mock" +) // DependenciesReaderPluginServer is an autogenerated mock type for the DependenciesReaderPluginServer type type DependenciesReaderPluginServer struct { diff --git a/proto-gen/storage_v1/mocks/SpanReaderPluginClient.go b/proto-gen/storage_v1/mocks/SpanReaderPluginClient.go index 2e096d1ea1d..04260efb966 100644 --- a/proto-gen/storage_v1/mocks/SpanReaderPluginClient.go +++ b/proto-gen/storage_v1/mocks/SpanReaderPluginClient.go @@ -2,10 +2,15 @@ package mocks -import context "context" -import grpc "google.golang.org/grpc" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) // SpanReaderPluginClient is an autogenerated mock type for the SpanReaderPluginClient type type SpanReaderPluginClient struct { diff --git a/proto-gen/storage_v1/mocks/SpanReaderPluginServer.go b/proto-gen/storage_v1/mocks/SpanReaderPluginServer.go index 622b64c0657..97cfac70ed8 100644 --- a/proto-gen/storage_v1/mocks/SpanReaderPluginServer.go +++ b/proto-gen/storage_v1/mocks/SpanReaderPluginServer.go @@ -2,9 +2,12 @@ package mocks -import context "context" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" + mock "github.com/stretchr/testify/mock" +) // SpanReaderPluginServer is an autogenerated mock type for the SpanReaderPluginServer type type SpanReaderPluginServer struct { diff --git a/proto-gen/storage_v1/mocks/SpanReaderPlugin_FindTracesClient.go b/proto-gen/storage_v1/mocks/SpanReaderPlugin_FindTracesClient.go index b0a6007f75f..7c7a735422e 100644 --- a/proto-gen/storage_v1/mocks/SpanReaderPlugin_FindTracesClient.go +++ b/proto-gen/storage_v1/mocks/SpanReaderPlugin_FindTracesClient.go @@ -2,10 +2,14 @@ package mocks -import context "context" -import metadata "google.golang.org/grpc/metadata" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + metadata "google.golang.org/grpc/metadata" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) // SpanReaderPlugin_FindTracesClient is an autogenerated mock type for the SpanReaderPlugin_FindTracesClient type type SpanReaderPlugin_FindTracesClient struct { diff --git a/proto-gen/storage_v1/mocks/SpanReaderPlugin_FindTracesServer.go b/proto-gen/storage_v1/mocks/SpanReaderPlugin_FindTracesServer.go index a8a053ebbb9..536048b8534 100644 --- a/proto-gen/storage_v1/mocks/SpanReaderPlugin_FindTracesServer.go +++ b/proto-gen/storage_v1/mocks/SpanReaderPlugin_FindTracesServer.go @@ -2,10 +2,14 @@ package mocks -import context "context" -import metadata "google.golang.org/grpc/metadata" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + metadata "google.golang.org/grpc/metadata" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) // SpanReaderPlugin_FindTracesServer is an autogenerated mock type for the SpanReaderPlugin_FindTracesServer type type SpanReaderPlugin_FindTracesServer struct { diff --git a/proto-gen/storage_v1/mocks/SpanReaderPlugin_GetTraceClient.go b/proto-gen/storage_v1/mocks/SpanReaderPlugin_GetTraceClient.go index fca0337a316..65e22b940c8 100644 --- a/proto-gen/storage_v1/mocks/SpanReaderPlugin_GetTraceClient.go +++ b/proto-gen/storage_v1/mocks/SpanReaderPlugin_GetTraceClient.go @@ -2,10 +2,14 @@ package mocks -import context "context" -import metadata "google.golang.org/grpc/metadata" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + metadata "google.golang.org/grpc/metadata" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) // SpanReaderPlugin_GetTraceClient is an autogenerated mock type for the SpanReaderPlugin_GetTraceClient type type SpanReaderPlugin_GetTraceClient struct { diff --git a/proto-gen/storage_v1/mocks/SpanReaderPlugin_GetTraceServer.go b/proto-gen/storage_v1/mocks/SpanReaderPlugin_GetTraceServer.go index a28a1b073e7..39aab8e3bd5 100644 --- a/proto-gen/storage_v1/mocks/SpanReaderPlugin_GetTraceServer.go +++ b/proto-gen/storage_v1/mocks/SpanReaderPlugin_GetTraceServer.go @@ -2,10 +2,14 @@ package mocks -import context "context" -import metadata "google.golang.org/grpc/metadata" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + metadata "google.golang.org/grpc/metadata" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) // SpanReaderPlugin_GetTraceServer is an autogenerated mock type for the SpanReaderPlugin_GetTraceServer type type SpanReaderPlugin_GetTraceServer struct { diff --git a/proto-gen/storage_v1/mocks/SpanWriterPluginClient.go b/proto-gen/storage_v1/mocks/SpanWriterPluginClient.go index fdc4e3c5fe2..3c9f43cc205 100644 --- a/proto-gen/storage_v1/mocks/SpanWriterPluginClient.go +++ b/proto-gen/storage_v1/mocks/SpanWriterPluginClient.go @@ -2,16 +2,51 @@ package mocks -import context "context" -import grpc "google.golang.org/grpc" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) // SpanWriterPluginClient is an autogenerated mock type for the SpanWriterPluginClient type type SpanWriterPluginClient struct { mock.Mock } +// Close provides a mock function with given fields: ctx, in, opts +func (_m *SpanWriterPluginClient) Close(ctx context.Context, in *storage_v1.CloseWriterRequest, opts ...grpc.CallOption) (*storage_v1.CloseWriterResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *storage_v1.CloseWriterResponse + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.CloseWriterRequest, ...grpc.CallOption) *storage_v1.CloseWriterResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.CloseWriterResponse) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.CloseWriterRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // WriteSpan provides a mock function with given fields: ctx, in, opts func (_m *SpanWriterPluginClient) WriteSpan(ctx context.Context, in *storage_v1.WriteSpanRequest, opts ...grpc.CallOption) (*storage_v1.WriteSpanResponse, error) { _va := make([]interface{}, len(opts)) diff --git a/proto-gen/storage_v1/mocks/SpanWriterPluginServer.go b/proto-gen/storage_v1/mocks/SpanWriterPluginServer.go index f9c98750de5..bebd44f5123 100644 --- a/proto-gen/storage_v1/mocks/SpanWriterPluginServer.go +++ b/proto-gen/storage_v1/mocks/SpanWriterPluginServer.go @@ -2,15 +2,41 @@ package mocks -import context "context" -import mock "github.com/stretchr/testify/mock" -import storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +import ( + context "context" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" + mock "github.com/stretchr/testify/mock" +) // SpanWriterPluginServer is an autogenerated mock type for the SpanWriterPluginServer type type SpanWriterPluginServer struct { mock.Mock } +// Close provides a mock function with given fields: _a0, _a1 +func (_m *SpanWriterPluginServer) Close(_a0 context.Context, _a1 *storage_v1.CloseWriterRequest) (*storage_v1.CloseWriterResponse, error) { + ret := _m.Called(_a0, _a1) + + var r0 *storage_v1.CloseWriterResponse + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.CloseWriterRequest) *storage_v1.CloseWriterResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.CloseWriterResponse) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.CloseWriterRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // WriteSpan provides a mock function with given fields: _a0, _a1 func (_m *SpanWriterPluginServer) WriteSpan(_a0 context.Context, _a1 *storage_v1.WriteSpanRequest) (*storage_v1.WriteSpanResponse, error) { ret := _m.Called(_a0, _a1) diff --git a/proto-gen/storage_v1/storage.pb.go b/proto-gen/storage_v1/storage.pb.go index 9ae71f2bce0..473e3966217 100644 --- a/proto-gen/storage_v1/storage.pb.go +++ b/proto-gen/storage_v1/storage.pb.go @@ -222,6 +222,86 @@ func (m *WriteSpanResponse) XXX_DiscardUnknown() { var xxx_messageInfo_WriteSpanResponse proto.InternalMessageInfo +// empty; extensible in the future +type CloseWriterRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CloseWriterRequest) Reset() { *m = CloseWriterRequest{} } +func (m *CloseWriterRequest) String() string { return proto.CompactTextString(m) } +func (*CloseWriterRequest) ProtoMessage() {} +func (*CloseWriterRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0d2c4ccf1453ffdb, []int{4} +} +func (m *CloseWriterRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CloseWriterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CloseWriterRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CloseWriterRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CloseWriterRequest.Merge(m, src) +} +func (m *CloseWriterRequest) XXX_Size() int { + return m.Size() +} +func (m *CloseWriterRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CloseWriterRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CloseWriterRequest proto.InternalMessageInfo + +// empty; extensible in the future +type CloseWriterResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CloseWriterResponse) Reset() { *m = CloseWriterResponse{} } +func (m *CloseWriterResponse) String() string { return proto.CompactTextString(m) } +func (*CloseWriterResponse) ProtoMessage() {} +func (*CloseWriterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0d2c4ccf1453ffdb, []int{5} +} +func (m *CloseWriterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CloseWriterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CloseWriterResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CloseWriterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CloseWriterResponse.Merge(m, src) +} +func (m *CloseWriterResponse) XXX_Size() int { + return m.Size() +} +func (m *CloseWriterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CloseWriterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CloseWriterResponse proto.InternalMessageInfo + type GetTraceRequest struct { TraceID github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_id"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -233,7 +313,7 @@ func (m *GetTraceRequest) Reset() { *m = GetTraceRequest{} } func (m *GetTraceRequest) String() string { return proto.CompactTextString(m) } func (*GetTraceRequest) ProtoMessage() {} func (*GetTraceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{4} + return fileDescriptor_0d2c4ccf1453ffdb, []int{6} } func (m *GetTraceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -272,7 +352,7 @@ func (m *GetServicesRequest) Reset() { *m = GetServicesRequest{} } func (m *GetServicesRequest) String() string { return proto.CompactTextString(m) } func (*GetServicesRequest) ProtoMessage() {} func (*GetServicesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{5} + return fileDescriptor_0d2c4ccf1453ffdb, []int{7} } func (m *GetServicesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -312,7 +392,7 @@ func (m *GetServicesResponse) Reset() { *m = GetServicesResponse{} } func (m *GetServicesResponse) String() string { return proto.CompactTextString(m) } func (*GetServicesResponse) ProtoMessage() {} func (*GetServicesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{6} + return fileDescriptor_0d2c4ccf1453ffdb, []int{8} } func (m *GetServicesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,7 +440,7 @@ func (m *GetOperationsRequest) Reset() { *m = GetOperationsRequest{} } func (m *GetOperationsRequest) String() string { return proto.CompactTextString(m) } func (*GetOperationsRequest) ProtoMessage() {} func (*GetOperationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{7} + return fileDescriptor_0d2c4ccf1453ffdb, []int{9} } func (m *GetOperationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,7 +495,7 @@ func (m *Operation) Reset() { *m = Operation{} } func (m *Operation) String() string { return proto.CompactTextString(m) } func (*Operation) ProtoMessage() {} func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{8} + return fileDescriptor_0d2c4ccf1453ffdb, []int{10} } func (m *Operation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -470,7 +550,7 @@ func (m *GetOperationsResponse) Reset() { *m = GetOperationsResponse{} } func (m *GetOperationsResponse) String() string { return proto.CompactTextString(m) } func (*GetOperationsResponse) ProtoMessage() {} func (*GetOperationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{9} + return fileDescriptor_0d2c4ccf1453ffdb, []int{11} } func (m *GetOperationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -531,7 +611,7 @@ func (m *TraceQueryParameters) Reset() { *m = TraceQueryParameters{} } func (m *TraceQueryParameters) String() string { return proto.CompactTextString(m) } func (*TraceQueryParameters) ProtoMessage() {} func (*TraceQueryParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{10} + return fileDescriptor_0d2c4ccf1453ffdb, []int{12} } func (m *TraceQueryParameters) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -627,7 +707,7 @@ func (m *FindTracesRequest) Reset() { *m = FindTracesRequest{} } func (m *FindTracesRequest) String() string { return proto.CompactTextString(m) } func (*FindTracesRequest) ProtoMessage() {} func (*FindTracesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{11} + return fileDescriptor_0d2c4ccf1453ffdb, []int{13} } func (m *FindTracesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -674,7 +754,7 @@ func (m *SpansResponseChunk) Reset() { *m = SpansResponseChunk{} } func (m *SpansResponseChunk) String() string { return proto.CompactTextString(m) } func (*SpansResponseChunk) ProtoMessage() {} func (*SpansResponseChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{12} + return fileDescriptor_0d2c4ccf1453ffdb, []int{14} } func (m *SpansResponseChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -721,7 +801,7 @@ func (m *FindTraceIDsRequest) Reset() { *m = FindTraceIDsRequest{} } func (m *FindTraceIDsRequest) String() string { return proto.CompactTextString(m) } func (*FindTraceIDsRequest) ProtoMessage() {} func (*FindTraceIDsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{13} + return fileDescriptor_0d2c4ccf1453ffdb, []int{15} } func (m *FindTraceIDsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -768,7 +848,7 @@ func (m *FindTraceIDsResponse) Reset() { *m = FindTraceIDsResponse{} } func (m *FindTraceIDsResponse) String() string { return proto.CompactTextString(m) } func (*FindTraceIDsResponse) ProtoMessage() {} func (*FindTraceIDsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{14} + return fileDescriptor_0d2c4ccf1453ffdb, []int{16} } func (m *FindTraceIDsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -808,7 +888,7 @@ func (m *CapabilitiesRequest) Reset() { *m = CapabilitiesRequest{} } func (m *CapabilitiesRequest) String() string { return proto.CompactTextString(m) } func (*CapabilitiesRequest) ProtoMessage() {} func (*CapabilitiesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{15} + return fileDescriptor_0d2c4ccf1453ffdb, []int{17} } func (m *CapabilitiesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -849,7 +929,7 @@ func (m *CapabilitiesResponse) Reset() { *m = CapabilitiesResponse{} } func (m *CapabilitiesResponse) String() string { return proto.CompactTextString(m) } func (*CapabilitiesResponse) ProtoMessage() {} func (*CapabilitiesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{16} + return fileDescriptor_0d2c4ccf1453ffdb, []int{18} } func (m *CapabilitiesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -897,6 +977,8 @@ func init() { proto.RegisterType((*GetDependenciesResponse)(nil), "jaeger.storage.v1.GetDependenciesResponse") proto.RegisterType((*WriteSpanRequest)(nil), "jaeger.storage.v1.WriteSpanRequest") proto.RegisterType((*WriteSpanResponse)(nil), "jaeger.storage.v1.WriteSpanResponse") + proto.RegisterType((*CloseWriterRequest)(nil), "jaeger.storage.v1.CloseWriterRequest") + proto.RegisterType((*CloseWriterResponse)(nil), "jaeger.storage.v1.CloseWriterResponse") proto.RegisterType((*GetTraceRequest)(nil), "jaeger.storage.v1.GetTraceRequest") proto.RegisterType((*GetServicesRequest)(nil), "jaeger.storage.v1.GetServicesRequest") proto.RegisterType((*GetServicesResponse)(nil), "jaeger.storage.v1.GetServicesResponse") @@ -916,73 +998,75 @@ func init() { func init() { proto.RegisterFile("storage.proto", fileDescriptor_0d2c4ccf1453ffdb) } var fileDescriptor_0d2c4ccf1453ffdb = []byte{ - // 1045 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x73, 0xdb, 0xc4, - 0x1b, 0xff, 0x2b, 0xb1, 0x6b, 0xfb, 0xb1, 0xd3, 0x7f, 0xb2, 0x76, 0xa9, 0x10, 0x34, 0x0e, 0x82, - 0xbc, 0xc0, 0x80, 0x4c, 0xcc, 0x01, 0x06, 0xca, 0x40, 0x9d, 0xa4, 0x9e, 0x00, 0x85, 0xa2, 0x66, - 0xe8, 0x0c, 0x85, 0x7a, 0xd6, 0xd6, 0xa2, 0xa8, 0xb1, 0x56, 0xaa, 0x5e, 0x3c, 0x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, 0xb1, - 0xf2, 0x82, 0x1f, 0x59, 0xe5, 0x9d, 0xcb, 0x40, 0x45, 0x04, 0x42, 0x40, 0x5c, 0x67, 0x7a, 0x9e, - 0x44, 0x29, 0xcf, 0x9c, 0x8b, 0x52, 0x5e, 0x30, 0x97, 0x0a, 0x53, 0x5e, 0x34, 0xa8, 0x7a, 0xf2, - 0x8b, 0xb3, 0x75, 0xe9, 0xcf, 0xb3, 0x75, 0xe9, 0x9f, 0xb3, 0x75, 0xe9, 0x7b, 0x10, 0xf0, 0xc1, - 0x64, 0x77, 0x78, 0x83, 0x2d, 0xb7, 0x0f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x66, 0x94, - 0xe3, 0x2f, 0x0c, 0x00, 0x00, + // 1074 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x73, 0xdb, 0x44, + 0x14, 0x47, 0x89, 0x5d, 0xdb, 0xcf, 0x4e, 0x49, 0xd6, 0x2e, 0x15, 0x82, 0xc6, 0x41, 0xd0, 0x24, + 0x30, 0x20, 0x13, 0x73, 0x80, 0x81, 0x32, 0x50, 0x27, 0xa9, 0x27, 0x40, 0xa1, 0xa8, 0x99, 0x76, + 0x86, 0x42, 0x3d, 0x6b, 0x6b, 0x51, 0x44, 0xac, 0x95, 0xaa, 0x3f, 0x1e, 0xfb, 0xc0, 0x8d, 0x0f, + 0xc0, 0x91, 0x13, 0x57, 0xbe, 0x07, 0xa7, 0x1e, 0x39, 0x73, 0x08, 0x4c, 0xae, 0x7c, 0x09, 0x46, + 0xbb, 0x2b, 0x59, 0xb2, 0x34, 0x49, 0x9a, 0xc9, 0x4d, 0xfb, 0xf6, 0xb7, 0xbf, 0xf7, 0xff, 0x3d, + 0xc1, 0x8a, 0x1f, 0x38, 0x1e, 0x36, 0x89, 0xe6, 0x7a, 0x4e, 0xe0, 0xa0, 0xb5,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67, 0x7a, 0x50, 0x45, 0x29, 0xcf, + 0x9c, 0x0b, 0xfb, 0x36, 0x3f, 0xf0, 0x0a, 0x53, 0x5e, 0x34, 0x01, 0x7b, 0xf2, 0xf3, 0xd3, 0x75, + 0xe9, 0xaf, 0xd3, 0x75, 0xe9, 0xdf, 0xd3, 0x75, 0xe9, 0x3b, 0x10, 0xf0, 0xc1, 0x64, 0x67, 0x78, + 0x8d, 0x6d, 0xcd, 0x0f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x16, 0x1d, 0x1e, 0xa6, 0xb5, 0x0c, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -999,6 +1083,7 @@ const _ = grpc.SupportPackageIsVersion4 type SpanWriterPluginClient interface { // spanstore/Writer WriteSpan(ctx context.Context, in *WriteSpanRequest, opts ...grpc.CallOption) (*WriteSpanResponse, error) + Close(ctx context.Context, in *CloseWriterRequest, opts ...grpc.CallOption) (*CloseWriterResponse, error) } type spanWriterPluginClient struct { @@ -1018,10 +1103,20 @@ func (c *spanWriterPluginClient) WriteSpan(ctx context.Context, in *WriteSpanReq return out, nil } +func (c *spanWriterPluginClient) Close(ctx context.Context, in *CloseWriterRequest, opts ...grpc.CallOption) (*CloseWriterResponse, error) { + out := new(CloseWriterResponse) + err := c.cc.Invoke(ctx, "/jaeger.storage.v1.SpanWriterPlugin/Close", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // SpanWriterPluginServer is the server API for SpanWriterPlugin service. type SpanWriterPluginServer interface { // spanstore/Writer WriteSpan(context.Context, *WriteSpanRequest) (*WriteSpanResponse, error) + Close(context.Context, *CloseWriterRequest) (*CloseWriterResponse, error) } // UnimplementedSpanWriterPluginServer can be embedded to have forward compatible implementations. @@ -1031,6 +1126,9 @@ type UnimplementedSpanWriterPluginServer struct { func (*UnimplementedSpanWriterPluginServer) WriteSpan(ctx context.Context, req *WriteSpanRequest) (*WriteSpanResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method WriteSpan not implemented") } +func (*UnimplementedSpanWriterPluginServer) Close(ctx context.Context, req *CloseWriterRequest) (*CloseWriterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Close not implemented") +} func RegisterSpanWriterPluginServer(s *grpc.Server, srv SpanWriterPluginServer) { s.RegisterService(&_SpanWriterPlugin_serviceDesc, srv) @@ -1054,6 +1152,24 @@ func _SpanWriterPlugin_WriteSpan_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _SpanWriterPlugin_Close_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CloseWriterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SpanWriterPluginServer).Close(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jaeger.storage.v1.SpanWriterPlugin/Close", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SpanWriterPluginServer).Close(ctx, req.(*CloseWriterRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _SpanWriterPlugin_serviceDesc = grpc.ServiceDesc{ ServiceName: "jaeger.storage.v1.SpanWriterPlugin", HandlerType: (*SpanWriterPluginServer)(nil), @@ -1062,6 +1178,10 @@ var _SpanWriterPlugin_serviceDesc = grpc.ServiceDesc{ MethodName: "WriteSpan", Handler: _SpanWriterPlugin_WriteSpan_Handler, }, + { + MethodName: "Close", + Handler: _SpanWriterPlugin_Close_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "storage.proto", @@ -1811,6 +1931,60 @@ func (m *WriteSpanResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *CloseWriterRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CloseWriterRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CloseWriterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *CloseWriterResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CloseWriterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CloseWriterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2447,6 +2621,30 @@ func (m *WriteSpanResponse) Size() (n int) { return n } +func (m *CloseWriterRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CloseWriterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *GetTraceRequest) Size() (n int) { if m == nil { return 0 @@ -3038,6 +3236,108 @@ func (m *WriteSpanResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *CloseWriterRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CloseWriterRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CloseWriterRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipStorage(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStorage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CloseWriterResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CloseWriterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CloseWriterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipStorage(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStorage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *GetTraceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From adabe88b67c40d4f661a535b9414d6ffcc0b7499 Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Tue, 7 Sep 2021 20:40:33 +0300 Subject: [PATCH 2/3] Update plugin/storage/grpc/shared/grpc_client.go Co-authored-by: Yuri Shkuro Signed-off-by: Fedor Korotkiy --- plugin/storage/grpc/shared/grpc_client.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugin/storage/grpc/shared/grpc_client.go b/plugin/storage/grpc/shared/grpc_client.go index d5a0d905e2e..4d27c0eb269 100644 --- a/plugin/storage/grpc/shared/grpc_client.go +++ b/plugin/storage/grpc/shared/grpc_client.go @@ -232,11 +232,7 @@ func (c *grpcClient) WriteSpan(ctx context.Context, span *model.Span) error { func (c *grpcClient) Close() error { _, err := c.writerClient.Close(context.Background(), &storage_v1.CloseWriterRequest{}) - if err != nil { - if status.Code(err) == codes.Unimplemented { - return nil - } - + if err != nil && status.Code(err) != codes.Unimplemented { return fmt.Errorf("plugin error: %w", err) } From a8abb3fa52a3cf4b719fae1b1c31a6ec8a9873c5 Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Wed, 8 Sep 2021 14:42:36 +0300 Subject: [PATCH 3/3] Return Unimplemented status Signed-off-by: Fedor Korotkiy --- plugin/storage/grpc/shared/grpc_server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/storage/grpc/shared/grpc_server.go b/plugin/storage/grpc/shared/grpc_server.go index bed633fe820..45ad763b42e 100644 --- a/plugin/storage/grpc/shared/grpc_server.go +++ b/plugin/storage/grpc/shared/grpc_server.go @@ -60,9 +60,11 @@ func (s *grpcServer) Close(ctx context.Context, r *storage_v1.CloseWriterRequest if err := closer.Close(); err != nil { return nil, err } - } - return &storage_v1.CloseWriterResponse{}, nil + return &storage_v1.CloseWriterResponse{}, nil + } else { + return nil, status.Error(codes.Unimplemented, "span writer does not support graceful shutdown") + } } // GetTrace takes a traceID and streams a Trace associated with that traceID