Uploaded image for project: 'Red Hat Advanced Cluster Security'
  1. Red Hat Advanced Cluster Security
  2. ROX-30333

Handle context cancelations in Sensor ProcessMessage

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Sensor
    • None
    • False
    • Hide

      None

      Show
      None
    • 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.

              Unassigned Unassigned
              prygiels@redhat.com Piotr Rygielski
              ACS Sensor & Ecosystem
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: