未验证 提交 a9fddf43 编写于 作者: W whhe 提交者: GitHub

add exception message in reconnect log (#2)

上级 8d75962a
...@@ -16,10 +16,14 @@ import com.oceanbase.clogproxy.common.config.ShareConf; ...@@ -16,10 +16,14 @@ import com.oceanbase.clogproxy.common.config.ShareConf;
import com.oceanbase.clogproxy.common.packet.LogType; import com.oceanbase.clogproxy.common.packet.LogType;
import com.oceanbase.clogproxy.common.util.CryptoUtil; import com.oceanbase.clogproxy.common.util.CryptoUtil;
import com.oceanbase.clogproxy.common.util.Hex; import com.oceanbase.clogproxy.common.util.Hex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map; import java.util.Map;
public class ObReaderConfig extends AbstractConnectionConfig { public class ObReaderConfig extends AbstractConnectionConfig {
private static final Logger logger = LoggerFactory.getLogger(ObReaderConfig.class);
private static final ConfigItem<String> RS_LIST = new ConfigItem<>("rootserver_list", ""); private static final ConfigItem<String> RS_LIST = new ConfigItem<>("rootserver_list", "");
private static final ConfigItem<String> CLUSTER_USER = new ConfigItem<>("cluster_user", ""); private static final ConfigItem<String> CLUSTER_USER = new ConfigItem<>("cluster_user", "");
private static final ConfigItem<String> CLUSTER_PASSWORD = new ConfigItem<>("cluster_password", ""); private static final ConfigItem<String> CLUSTER_PASSWORD = new ConfigItem<>("cluster_password", "");
...@@ -50,6 +54,7 @@ public class ObReaderConfig extends AbstractConnectionConfig { ...@@ -50,6 +54,7 @@ public class ObReaderConfig extends AbstractConnectionConfig {
} }
return true; return true;
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error(e.getMessage());
return false; return false;
} }
} }
......
...@@ -159,7 +159,7 @@ public class ClientStream { ...@@ -159,7 +159,7 @@ public class ClientStream {
return; return;
} catch (Exception e) { } catch (Exception e) {
// if exception occured, we exit // if exception occurred, we exit
triggerStop(); triggerStop();
triggerException(new LogProxyClientException(ErrorCode.E_USER, e)); triggerException(new LogProxyClientException(ErrorCode.E_USER, e));
return; return;
...@@ -221,7 +221,7 @@ public class ClientStream { ...@@ -221,7 +221,7 @@ public class ClientStream {
return ReconnectState.RETRY; return ReconnectState.RETRY;
} catch (Exception e) { } catch (Exception e) {
logger.error("failed to reconnect, retry count: {}, max: {}", ++retryTimes, ClientConf.MAX_RECONNECT_TIMES); logger.error("failed to reconnect, retry count: {}, max: {}, message: {}", ++retryTimes, ClientConf.MAX_RECONNECT_TIMES, e.getMessage());
// not success, retry next time // not success, retry next time
reconnect.set(true); reconnect.set(true);
return ReconnectState.RETRY; return ReconnectState.RETRY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册