Skip to content

Commit

Permalink
Catch all exception during binlog client connect/disconnect (opensear…
Browse files Browse the repository at this point in the history
…ch-project#5176)

Signed-off-by: Hai Yan <[email protected]>
  • Loading branch information
oeyh authored Nov 8, 2024
1 parent 8fd743d commit 60990cd
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Optional;

public class StreamWorker {
Expand Down Expand Up @@ -57,12 +56,12 @@ public void processStream(final StreamPartition streamPartition) {
try {
LOG.info("Connect to database to read change events.");
binaryLogClient.connect();
} catch (IOException e) {
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
try {
binaryLogClient.disconnect();
} catch (IOException e) {
} catch (Exception e) {
LOG.error("Binary log client failed to disconnect.", e);
}
}
Expand Down

0 comments on commit 60990cd

Please sign in to comment.