Skip to content

Commit 2f59f35

Browse files
linguoxuanguoxuanlin
andauthored
[FLINK-38601][connect/mongodb] Catch throwable errors when consuming from unbounded streams (#4213)
Co-authored-by: guoxuanlin <guoxuanlin@tencent.com>
1 parent 8e9474f commit 2f59f35

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mongodb-cdc/src/main/java/org/apache/flink/cdc/connectors/mongodb/source/reader/fetch/MongoDBStreamFetchTask.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ public void execute(Context context) throws Exception {
221221
} catch (Exception e) {
222222
LOG.error("Poll change stream records failed ", e);
223223
throw e;
224+
} catch (Throwable t) {
225+
// Handle error
226+
LOG.error("Fatal error when polling change stream records: ", t);
227+
throw new RuntimeException("Fatal error when polling change stream records", t);
224228
} finally {
225229
taskRunning = false;
226230
if (changeStreamCursor != null) {

0 commit comments

Comments
 (0)