Skip to content

Commit 1a55bd4

Browse files
Fricounetimeoer
authored andcommitted
[adapter] Use context without cancel for GC
The GC triggered in a goroutine after the Convert operation is done was called with the same context passed down. However, when the convert action is called synchronously (accelctl --sync), the associated context is canceled when the sync operation is completed. Since the GC was run after, it was failing with a `context canceled` error. To solve this, we now remove the `cancel` from the context passed down to the GC. Signed-off-by: Baptiste Girard-Carrabin <baptiste.girardcarrabin@datadoghq.com>
1 parent 4cb8d25 commit 1a55bd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/adapter/adapter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (adp *LocalAdapter) Convert(ctx context.Context, source string) (*converter
137137
}
138138
return nil, err
139139
}
140-
go adp.content.GC(ctx, adp.content.Threshold)
140+
go adp.content.GC(context.WithoutCancel(ctx), adp.content.Threshold)
141141
return metric, nil
142142
}
143143

0 commit comments

Comments
 (0)