You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "TaoZex (via GitHub)" <gi...@apache.org> on 2023/03/13 09:28:20 UTC
[GitHub] [incubator-seatunnel] TaoZex commented on a diff in pull request #4327: [bugfix][cdc-base] Fix cdc base shutdown thread not cleared
TaoZex commented on code in PR #4327:
URL: https://github.com/apache/incubator-seatunnel/pull/4327#discussion_r1133648215
##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/external/IncrementalSourceStreamFetcher.java:
##########
@@ -121,13 +121,17 @@ private void checkReadException() {
@Override
public void close() {
try {
+ if (streamFetchTask != null) {
+ streamFetchTask.shutdown();
+ }
if (executorService != null) {
executorService.shutdown();
- if (executorService.awaitTermination(
+ if (!executorService.awaitTermination(
READER_CLOSE_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
log.warn(
- "Failed to close the stream fetcher in {} seconds.",
+ "Failed to close the stream fetcher in {} seconds. will execute force close(ExecutorService.shutdownNow)",
Review Comment:
```suggestion
"Failed to close the stream fetcher in {} seconds. Service will execute force close(ExecutorService.shutdownNow)",
```
##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/external/IncrementalSourceScanFetcher.java:
##########
@@ -192,13 +192,17 @@ private void checkReadException() {
@Override
public void close() {
try {
+ if (snapshotSplitReadTask != null) {
+ snapshotSplitReadTask.shutdown();
+ }
if (executorService != null) {
executorService.shutdown();
- if (executorService.awaitTermination(
+ if (!executorService.awaitTermination(
READER_CLOSE_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
log.warn(
- "Failed to close the scan fetcher in {} seconds.",
+ "Failed to close the scan fetcher in {} seconds. will execute force close(ExecutorService.shutdownNow)",
Review Comment:
```suggestion
"Failed to close the scan fetcher in {} seconds. Service will execute force close(ExecutorService.shutdownNow)",
```
--
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@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org