This check, and the one below verifies that self.state, which at this point is always equal to SHUTDOWN, regardless of the actual state of the pipeline:
|
if self.state != PipelineState.SHUTDOWN: |
A minimal fix would be to retrieve the pipeline state before this check. But I actually think that we shouldn't try to track pipeline state in a local variable and should just always request it from the pipeline.