You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is this needed:
In #2487, we added the ability to cancel the AllLocations iterator on the various file resolvers to prevent a go-routine leak. However, the context passed in here is generally created within a cataloger. Pass in context into the catalogers from the top. This paves the way for enabling cancellation and timeouts, and for long-running processes to more easily consume syft as a library.
Before we freeze the exported API for 1.0, we should pass context down.
What would you like to be added:
We should also pass context down via the cataloger interface: https://github.com/anchore/syft/blob/main/syft/pkg/cataloger.go#L15.
Why is this needed:
In #2487, we added the ability to cancel the AllLocations iterator on the various file resolvers to prevent a go-routine leak. However, the context passed in here is generally created within a cataloger. Pass in context into the catalogers from the top. This paves the way for enabling cancellation and timeouts, and for long-running processes to more easily consume syft as a library.
Before we freeze the exported API for 1.0, we should pass context down.
Context should be added at this line: https://github.com/anchore/syft/blob/3046d43a8a225902590ae012a58b04836590ce54/internal/task/package_task_factory.go#L103C33-L103C40. Context is already passed down that far. This issue can be closed when it is passed down from there into the catalogers.
Also, search the codebase for
context.Background()
and wire it up to the catalogers context.Additional context:
Originally requested as comment: #2487 (comment)
The text was updated successfully, but these errors were encountered: