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

add exception message in reconnect log (#2)

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