Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We run builtin connector functions in a sandbox, making it possible to "detach" from the plugin. In this PR we remove this sandbox for calls to
Run
, as it prevents us from doing a graceful shutdown.Shutdown logs before the change
Shutdown logs after the change
When the pipeline stops we cancel the context passed to
Run
with the intention to close the bi-directional stream opened between the connector and Conduit. However, the sandbox interprets the closed context as the intention that we want to detach from that function and keep it running in the background. In case ofRun
this doesn't make sense, because it is already running in the background, so we will never want to detach from it.The second reason for the sandbox is to catch any panics the connector might produce (well at least it's a best effort). Again, in
Run
this won't make a difference, because the SDK will spawn two separate goroutines for the incoming and outgoing stream (acks and records), so panics that happen in those goroutines won't be caught by the sandbox anyway.Quick checks