Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clients/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (c *DestinationClient) Write2(ctx context.Context, tables schema.Tables, so
if err := saveClient.Send(&pb.Write2_Request{
Resource: resource,
}); err != nil {
return fmt.Errorf("failed to call Write.Send: %w", err)
return fmt.Errorf("failed to call Write2.Send: %w", err)
}
}
_, err = saveClient.CloseAndRecv()
Expand Down Expand Up @@ -330,7 +330,7 @@ func (c *DestinationClient) Terminate() error {

if c.grpcSocketName != "" {
defer func() {
if err := os.Remove(c.grpcSocketName); err != nil {
if err := os.RemoveAll(c.grpcSocketName); err != nil {
c.logger.Error().Err(err).Msg("failed to remove destination socket file")
}
}()
Expand Down
2 changes: 1 addition & 1 deletion clients/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (c *SourceClient) Terminate() error {

if c.grpcSocketName != "" {
defer func() {
if err := os.Remove(c.grpcSocketName); err != nil {
if err := os.RemoveAll(c.grpcSocketName); err != nil {
c.logger.Error().Err(err).Msg("failed to remove source socket file")
}
}()
Expand Down
4 changes: 2 additions & 2 deletions plugins/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ func (p *DestinationPlugin) Write(ctx context.Context, tables schema.Tables, sou
syncTime = syncTime.UTC()
SetDestinationManagedCqColumns(tables)
ch := make(chan *ClientResource)
eg, ctx := errgroup.WithContext(ctx)
eg, gctx := errgroup.WithContext(ctx)
// given most destination plugins writing in batch we are using a worker pool to write in parallel
// it might not generalize well and we might need to move it to each destination plugin implementation.
for i := 0; i < writeWorkers; i++ {
eg.Go(func() error {
return p.client.Write(ctx, tables, ch)
return p.client.Write(gctx, tables, ch)
})
}
sourceColumn := &schema.Text{}
Expand Down