MINOR: Handle case where connector status endpoints returns 404#6176
MINOR: Handle case where connector status endpoints returns 404#6176mjsax merged 5 commits intoapache:trunkfrom
Conversation
c1ed1c8 to
14f01d5
Compare
4358167 to
6c4b917
Compare
There was a problem hiding this comment.
Do all the places where this method is called handle null? There is no JavaDoc that explains/summarizes what will be returned, so maybe add that JavaDoc. The AbstractHerder never returns null and instead throws a NotFoundException when the named connector is not found.
There was a problem hiding this comment.
I removed this check, and documented the behavior. thanks!
There was a problem hiding this comment.
Nit: why use an else block here? The if block always returns, so really no else is needed, right?
There was a problem hiding this comment.
The exception can contain any arbitrary status code. We are only calling the else block if the status code is not 404.
There was a problem hiding this comment.
This appears in the two connector integration tests in AK's codebase. Should TestUtils or EmbeddedConnectCluster have a method that does this?
There was a problem hiding this comment.
Would it also be helpful here to catch any exceptions that might be thrown by the condition?
There was a problem hiding this comment.
TestUtils is in the clients module. And adding it to EmbeddedConnectCluster seemed incorrect as this method depends on checking that depended on ConnectorHandle. I've moved it to an IntegrationTestUtils class. Let me know what you think.
86b0161 to
4419f19
Compare
rhauch
left a comment
There was a problem hiding this comment.
One more minor suggestion just to ward off a potentially alarming log message. Otherwise, looks good.
...runtime/src/test/java/org/apache/kafka/connect/integration/ErrorHandlingIntegrationTest.java
Outdated
Show resolved
Hide resolved
fcc6917 to
a148226
Compare
|
@rhauch I've addressed your comments. There is a bit of code duplication in the tests but we can address that in a follow up PR. |
rhauch
left a comment
There was a problem hiding this comment.
Looks great, @wicknicks! Thanks for fixing this and addressing my nits and questions.
|
retest this please. |
Signed-off-by: Arjun Satish <arjun@confluent.io>
Signed-off-by: Arjun Satish <arjun@confluent.io>
Signed-off-by: Arjun Satish <arjun@confluent.io>
a148226 to
a6e21fc
Compare
|
retest this please. |
…swallows exceptions Signed-off-by: Arjun Satish <arjun@confluent.io>
a6e21fc to
f700c80
Compare
|
retest this please |
Signed-off-by: Arjun Satish <arjun@confluent.io>
|
retest this please |
|
Ok. One last try. If it fails again, I will merge with one green build. Retest this please. |
|
We got some green builds before. Merging as-is. |
|
Thanks a lot, @mjsax! |
Reviewers: Randall Hauch <randall@confluent.io>, Matthias J. Sax <matthias@confluent.io>
Reviewers: Randall Hauch <randall@confluent.io>, Matthias J. Sax <matthias@confluent.io>
|
Merged to |
…he#6176) Reviewers: Randall Hauch <randall@confluent.io>, Matthias J. Sax <matthias@confluent.io>
* ak/trunk: MINOR: fix race condition in KafkaStreamsTest (apache#6185) KAFKA-4850: Enable bloomfilters (apache#6012) MINOR: ducker-ak: add down -f, avoid using a terminal in ducker test KAFKA-5117: Stop resolving externalized configs in Connect REST API MINOR: Cleanup handling of mixed transactional/idempotent records (apache#6172) KAFKA-7844: Use regular subproject for generator to fix *All targets (apache#6182) Fix Documentation for cleanup.policy is out of date (apache#6181) MINOR: increase timeouts for KafkaStreamsTest (apache#6178) MINOR: Rejoin split ssl principal mapping rules (apache#6099) MINOR: Handle case where connector status endpoints returns 404 (apache#6176) MINOR: Remove unused imports, exceptions, and values (apache#6117) KAFKA-3522: Add internal RecordConverter interface (apache#6150) Fix Javadoc of KafkaConsumer (apache#6155) KAFKA-6455: Extend CacheFlushListener to forward timestamp (apache#6147) MINOR: Log partition info when creating new request batch in controller (apache#6145) KAFKA-7652: Part I; Fix SessionStore's findSession(single-key) (apache#6134) MINOR: Remove the InvalidTopicException handling in InternalTopicManager (apache#6167) [KAFKA-7024] Rocksdb state directory should be created before opening the DB (apache#6138) MINOR:: Fix typos (apache#6079)
…he#6176) Reviewers: Randall Hauch <randall@confluent.io>, Matthias J. Sax <matthias@confluent.io>
The integration test framework for Connect provides a
org.apache.kafka.connect.util.clusters.EmbeddedConnectCluster#connectorStatusmethod that checks the status of a Connector via the REST endpoint and deserializes the response into aConnectorStateInfoobject. If the connector creation request has just been finished, and task creation delayed for some reason (for example, rebalancing is ongoing), the REST API returns a 404 on theconnectors/{connectorName}/statusendpoint, and causes the test to fail with the exception:This fix handles the 404 case instead of simply re-throwing the Exception.
Signed-off-by: Arjun Satish arjun@confluent.io
Committer Checklist (excluded from commit message)