-
Task
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
-
False
-
-
False
-
-
Context: https://github.com/stackrox/stackrox/pull/16064
Sensor handles messages from Central in Components using function `ProcessMessage(context, message)`. In some components, the message is forwarded over a channel to an object that will process it. This implies that the context cancelation handling cannot happen in `ProcessMessage` but instead the context and its cancel() func must be forwarded with the message to the same place where the handling of the message is done.
At the time of writing, this is the case in:
- `sensor/kubernetes/complianceoperator/handler_impl.go`
- `sensor/kubernetes/networkpolicies/command_handler.go`
- `sensor/common/compliance/command_handler_impl.go`
In both those places, there are only TODO markers and the context cancelation is ignored.
This ticket is about properly handling the context cancelations in the components listed, so that canceling the context interrupts and stops processing of the current message, but does not stop the component itself, so that next messages can be handled.