fix(connectors): reject duplicate iggy_sink_open to prevent silent data loss#3178
Closed
MukundaKatta wants to merge 1 commit into
Closed
fix(connectors): reject duplicate iggy_sink_open to prevent silent data loss#3178MukundaKatta wants to merge 1 commit into
MukundaKatta wants to merge 1 commit into
Conversation
…ta loss The sink_connector! macro inserted a fresh SinkContainer over any existing entry in INSTANCES, dropping the prior container without invoking close(). Sinks with buffered state (e.g. DeltaSink, which holds JSON rows in a JsonWriter before flushing to the Delta log) lost every unflushed record on a duplicate open with no surfaced error. Guard the FFI entry with a contains_key check via a small helper so callers can drain explicitly before re-opening. Apply the same guard to source_connector! since it has the same overwrite shape (drops the shutdown channel and JoinHandle for the polling task without awaiting them). Closes apache#3168. Signed-off-by: Mukunda Rao Katta <mukunda.vjcs6@gmail.com>
Contributor
Author
|
Closing: bad commit, the source files were replaced with path strings instead of the actual content. Apologies for the noise. Will re-open with the correct diff. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #3168.
The
sink_connector!macro accepted a secondiggy_sink_opencall without surfacing an error, silently discarding any data buffered against the first session. Reject the duplicate so callers see the failure and can drain explicitly before re-opening. The same guard is applied tosource_connector!since it has the same overwrite shape.Test:
core/connectors/sdk/src/sink.rs::tests::guard_duplicate_open_allows_first_call_and_rejects_second(and the matching one insource.rs).