Skip to content

[fix][io] Close the kafka source connector if there is uncaught exception#20424

Merged
RobertIndie merged 2 commits intoapache:masterfrom
RobertIndie:fix-kafka-source
May 29, 2023
Merged

[fix][io] Close the kafka source connector if there is uncaught exception#20424
RobertIndie merged 2 commits intoapache:masterfrom
RobertIndie:fix-kafka-source

Conversation

@RobertIndie
Copy link
Copy Markdown
Member

Fixes #19880

Motivation

If any unexpected and uncaught exceptions are thrown in the runnerThread of the Kafka source connector, the connector will just log that message and get stuck. The connector won't exit but won't do anything either.

Modifications

  • Close the connector if there is uncaught exception

Verifying this change

This change added tests

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

…ght exception

Signed-off-by: Zike Yang <zike@apache.org>
@RobertIndie RobertIndie added type/bug The PR fixed a bug or issue reported a bug area/connector ready-to-test labels May 29, 2023
@RobertIndie RobertIndie added this to the 3.1.0 milestone May 29, 2023
@RobertIndie RobertIndie self-assigned this May 29, 2023
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label May 29, 2023
@RobertIndie RobertIndie changed the title [fix][pulsar-io] Close the kafka source connector if there is uncaught exception [fix][io] Close the kafka source connector if there is uncaught exception May 29, 2023
…ectedExceptionThrownTest`

Signed-off-by: Zike Yang <zike@apache.org>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2023

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.91%. Comparing base (aa3bfcd) to head (6d6d8a2).
⚠️ Report is 2487 commits behind head on master.

Files with missing lines Patch % Lines
...rg/apache/pulsar/io/kafka/KafkaAbstractSource.java 60.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #20424   +/-   ##
=========================================
  Coverage     72.90%   72.91%           
- Complexity    31864    31896   +32     
=========================================
  Files          1864     1865    +1     
  Lines        138416   138443   +27     
  Branches      15188    15192    +4     
=========================================
+ Hits         100919   100945   +26     
- Misses        29477    29488   +11     
+ Partials       8020     8010   -10     
Flag Coverage Δ
inttests 24.14% <0.00%> (-0.03%) ⬇️
systests 24.95% <0.00%> (-0.11%) ⬇️
unittests 72.19% <60.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rg/apache/pulsar/io/kafka/KafkaAbstractSource.java 69.06% <60.00%> (+0.17%) ⬆️

... and 68 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codelipenghui
Copy link
Copy Markdown
Contributor

@liudezhi2098 the label "cherry-picked/*" should be only added after the PR is cherry-picked. If you want to make the PR should be cherry-picked to branch-2.10, you should add "release/2.10.5".

@codelipenghui
Copy link
Copy Markdown
Contributor

@RobertIndie Could you please help cherry-pick this PR to release branches?

RobertIndie added a commit that referenced this pull request Jun 2, 2023
…tion (#20424)

Fixes #19880

### Motivation

If any unexpected and uncaught exceptions are thrown in the `runnerThread` of the Kafka source connector, the connector will just log that message and get stuck. The connector won't exit but won't do anything either.

### Modifications

* Close the connector if there is uncaught exception

Signed-off-by: Zike Yang <zike@apache.org>
(cherry picked from commit 6079a91)
@RobertIndie
Copy link
Copy Markdown
Member Author

The cherry-picked commit for branch-2.10: 49eaa30
The cherry-picked commit for branch-2.11: 4eacf04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants