The sampler may not need to hold an opened stream as the stream may get terminated by any external reasons. The sampler then keeps failing on getting a sample image and the orchestrator (i.e., Kubernetes) may not catch it as the plugin would seem running okay.
It would be safer and more resource-efficient if the sampler opens up a stream right before sampling. This ensures if the input source is connectable. If it fails the sampler can terminate itself, which will inform a failure to the orchestrator.
The sampler may not need to hold an opened stream as the stream may get terminated by any external reasons. The sampler then keeps failing on getting a sample image and the orchestrator (i.e., Kubernetes) may not catch it as the plugin would seem running okay.
It would be safer and more resource-efficient if the sampler opens up a stream right before sampling. This ensures if the input source is connectable. If it fails the sampler can terminate itself, which will inform a failure to the orchestrator.