You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/10/20 18:57:24 UTC

[GitHub] [pulsar] dlg99 opened a new pull request #12441: KCA doesn't handle unchecked unchecked ConnectException/KafkaException for the task, it may lead to the connector hanging

dlg99 opened a new pull request #12441:
URL: https://github.com/apache/pulsar/pull/12441


   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull request.
       Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ### Motivation
   
   The source can throw unchecked KafkaException/ConnectException.
   This is not handled properly and may result in hanging connector, as experience din prod with Debezium Postgres connector.
   
   ### Modifications
   
   Added unit test to repro the issue and fixed it.
   Also now KCA Source will throw exception in read() if the flush failed. This will allow connector fail fast and restart instead of doing something while the task cannot flush/ 
   
   ### Verifying this change
   
   This change added unit test
   
   ### Does this pull request potentially affect one of the following parts:
   
   NO
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)
   
   ### Documentation
   
   - [X] `no-need-doc` 
     
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli merged pull request #12441: KCA doesn't handle unchecked ConnectException/KafkaException for the task, it may lead to the connector hanging

Posted by GitBox <gi...@apache.org>.
eolivelli merged pull request #12441:
URL: https://github.com/apache/pulsar/pull/12441


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] dlg99 commented on a change in pull request #12441: KCA doesn't handle unchecked ConnectException/KafkaException for the task, it may lead to the connector hanging

Posted by GitBox <gi...@apache.org>.
dlg99 commented on a change in pull request #12441:
URL: https://github.com/apache/pulsar/pull/12441#discussion_r734207987



##########
File path: pulsar-io/kafka-connect-adaptor/src/test/java/org/apache/pulsar/io/kafka/connect/ErrFileStreamSourceTask.java
##########
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pulsar.io.kafka.connect;
+
+import org.apache.kafka.connect.file.FileStreamSourceTask;
+
+public class ErrFileStreamSourceTask extends FileStreamSourceTask {
+
+    @Override
+    public void commit() throws InterruptedException {
+        throw new org.apache.kafka.connect.errors.ConnectException("blah");

Review comment:
       @congbobo184 ErrFileStreamSourceTask is used in the test KafkaConnectSourceErrTest; this mimics the behavior encountered with debezium connector (commit throws ConnectException). The test used to hang at the kafkaConnectSource.read() call without the fix. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] congbobo184 commented on a change in pull request #12441: KCA doesn't handle unchecked ConnectException/KafkaException for the task, it may lead to the connector hanging

Posted by GitBox <gi...@apache.org>.
congbobo184 commented on a change in pull request #12441:
URL: https://github.com/apache/pulsar/pull/12441#discussion_r734173433



##########
File path: pulsar-io/kafka-connect-adaptor/src/test/java/org/apache/pulsar/io/kafka/connect/ErrFileStreamSourceTask.java
##########
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.pulsar.io.kafka.connect;
+
+import org.apache.kafka.connect.file.FileStreamSourceTask;
+
+public class ErrFileStreamSourceTask extends FileStreamSourceTask {
+
+    @Override
+    public void commit() throws InterruptedException {
+        throw new org.apache.kafka.connect.errors.ConnectException("blah");

Review comment:
       why add this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org