fix(kafka-connect): apply connector state transition alongside config update - #826
Merged
Merged
Conversation
Contributor
Security Scan ResultsVulnerabilities detected: Scanned by Trivy |
fhussonnois
force-pushed
the
fix/gh-821
branch
from
September 26, 2026 18:36
2e05e34 to
da3c422
Compare
… update
When an update changed both a connector's config and its spec.state, only
PUT /connectors/{name}/config was sent. That endpoint never changes the
target state, yet the whole change was reported as applied.
The handler now sends both: it pauses or stops the connector before
updating its config, and resumes it after the new config is applied. A
failure in either step is reported as an error. Non-actionable target
states (UNASSIGNED, RESTARTING, FAILED) now return an error instead of
being silently dropped.
Fixes #821
fhussonnois
force-pushed
the
fix/gh-821
branch
from
September 26, 2026 18:51
da3c422 to
85407e9
Compare
|
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.



Fixes #821
Problem
When a single
jikkou applychanged both aKafkaConnector's config and itsspec.state,KafkaConnectorChangeHandleronly sentPUT /connectors/{name}/config. That endpoint never changes a connector's target state, but theChangeResponsecovered the wholeResourceChange, so the state change was reported as applied and jikkou exited 0 while the connector stayedRUNNING.Fix
updateConnectornow sends the config update and the state transition together, ordered by the target state:PAUSED/STOPPEDPUT /config(tasks never run with the new config)RUNNINGPUT /config, then resume (the connector resumes with the new config)Both calls run sequentially in a single future, so a failure in the first step skips the second and the change is reported as an error.
Also in this method:
UNASSIGNED,RESTARTINGorFAILEDnow returns an error instead of being silently dropped (noChangeResponseat all).case REPLACEreturnsStream.empty()instead ofnull.Tests
New cases in
KafkaConnectorChangeHandlerTest(all failed before the fix):PAUSED: pause then config update (InOrder)STOPPED: stop then config updateRUNNING: config update then resumeFAILEDtarget state: error reported, no API call./mvnw test -pl providers/jikkou-provider-kafka-connectis green;spotless:checkpasses.