diff --git a/.github/workflows/unittest-post.yml b/.github/workflows/unittest-post.yml.backup similarity index 100% rename from .github/workflows/unittest-post.yml rename to .github/workflows/unittest-post.yml.backup diff --git a/internal/clients/state/v3/state.go b/internal/clients/state/v3/state.go index d4c01fc375..acc1d39a02 100644 --- a/internal/clients/state/v3/state.go +++ b/internal/clients/state/v3/state.go @@ -3,7 +3,6 @@ package state import ( "bytes" "context" - "fmt" "io" "sync" @@ -71,6 +70,9 @@ func NewClient(ctx context.Context, pbClient pb.PluginClient, tableName string) }); err != nil { return nil, err } + if _, err := writeClient.CloseAndRecv(); err != nil { + return nil, err + } readClient, err := c.client.Read(ctx, &pb.Read_Request{ Table: tableBytes, @@ -158,5 +160,5 @@ func (c *Client) GetKey(_ context.Context, key string) (string, error) { if val, ok := c.mem[key]; ok { return val, nil } - return "", fmt.Errorf("key not found") + return "", nil } diff --git a/state/state.go b/state/state.go index d90b595ef2..a2f05737e7 100644 --- a/state/state.go +++ b/state/state.go @@ -14,6 +14,7 @@ import ( type Client interface { SetKey(ctx context.Context, key string, value string) error GetKey(ctx context.Context, key string) (string, error) + Flush(ctx context.Context) error } func NewClient(ctx context.Context, conn *grpc.ClientConn, tableName string) (Client, error) {