[
https://issues.apache.org/jira/browse/KAFKA-16987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18101192#comment-18101192
]
Yunseop Eom commented on KAFKA-16987:
-------------------------------------
Opened PR #23056: https://github.com/apache/kafka/pull/23056
The implementation performs connector-owned resource cleanup immediately after
initialization, startup, or external failure while preserving FAILED status so
a later STOPPED target-state request is still processed. It calls stop() at
most once per start lifecycle, preserves the original failure if stop() also
throws, and closes the connector context, metrics, and offset resources.
Validation:
- WorkerConnectorTest: all tests passed, including source/sink initialization,
startup, external-failure, and stop-failure cases
- ConnectWorkerIntegrationTest.testStoppedState: passed
- Spotless, Checkstyle, and SpotBugs: passed
- Full connect:runtime test run completed 1,529 tests; one unrelated
timing-sensitive OffsetStorageReader test passed when rerun independently
> Release connector resources when entering FAILED state
> ------------------------------------------------------
>
> Key: KAFKA-16987
> URL: https://issues.apache.org/jira/browse/KAFKA-16987
> Project: Kafka
> Issue Type: Improvement
> Components: connect
> Reporter: Greg Harris
> Priority: Minor
>
> Connectors will enter the FAILED state if an unexpected exception appears.
> Connectors may also have resources associated with them that must be
> explicitly cleaned up by calling stop().
> Currently, this cleanup only takes place when the connectors are requested to
> shut down and the state transits to UNASSIGNED. This cleanup can be done
> earlier, so that resources are not held while the connector or task is in the
> FAILED state.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)