Skip to content

fix(connectors): reject duplicate iggy_sink_open to prevent silent data loss#3178

Closed
MukundaKatta wants to merge 1 commit into
apache:masterfrom
MukundaKatta:fix/sink-connector-duplicate-open
Closed

fix(connectors): reject duplicate iggy_sink_open to prevent silent data loss#3178
MukundaKatta wants to merge 1 commit into
apache:masterfrom
MukundaKatta:fix/sink-connector-duplicate-open

Conversation

@MukundaKatta
Copy link
Copy Markdown
Contributor

Closes #3168.

The sink_connector! macro accepted a second iggy_sink_open call 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 to source_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 in source.rs).

…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>
@MukundaKatta
Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sink_connector! macro silently discards buffered data on duplicate iggy_sink_open with same ID

1 participant