From df1428f3230ad516ad29364721ccd2a5fdc58871 Mon Sep 17 00:00:00 2001 From: Jevin Jiang <40829263+jevinjiang@users.noreply.github.com> Date: Thu, 21 Mar 2024 01:33:54 +0800 Subject: [PATCH] [ISSUE #4795] Replace this exception in beginFlush() with log print and return false (#4797) --- .../offsetmgmt/api/storage/OffsetStorageWriterImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eventmesh-openconnect/eventmesh-openconnect-offsetmgmt-plugin/eventmesh-openconnect-offsetmgmt-api/src/main/java/org/apache/eventmesh/openconnect/offsetmgmt/api/storage/OffsetStorageWriterImpl.java b/eventmesh-openconnect/eventmesh-openconnect-offsetmgmt-plugin/eventmesh-openconnect-offsetmgmt-api/src/main/java/org/apache/eventmesh/openconnect/offsetmgmt/api/storage/OffsetStorageWriterImpl.java index 76931d85a9..3c5ed033a8 100644 --- a/eventmesh-openconnect/eventmesh-openconnect-offsetmgmt-plugin/eventmesh-openconnect-offsetmgmt-api/src/main/java/org/apache/eventmesh/openconnect/offsetmgmt/api/storage/OffsetStorageWriterImpl.java +++ b/eventmesh-openconnect/eventmesh-openconnect-offsetmgmt-plugin/eventmesh-openconnect-offsetmgmt-api/src/main/java/org/apache/eventmesh/openconnect/offsetmgmt/api/storage/OffsetStorageWriterImpl.java @@ -84,7 +84,8 @@ private boolean isFlushing() { */ public synchronized boolean beginFlush() { if (isFlushing()) { - throw new RuntimeException("OffsetStorageWriter is already flushing"); + log.warn("OffsetStorageWriter is already flushing"); + return false; } if (data.isEmpty()) { return false;