Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
7d1be03a
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7d1be03a
编写于
3月 27, 2019
作者:
P
proller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CLICKHOUSE-4386 Version in exceptions
上级
6e3f7f62
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
26 deletion
+25
-26
dbms/src/Common/Exception.cpp
dbms/src/Common/Exception.cpp
+11
-10
libs/libdaemon/src/BaseDaemon.cpp
libs/libdaemon/src/BaseDaemon.cpp
+14
-16
未找到文件。
dbms/src/Common/Exception.cpp
浏览文件 @
7d1be03a
#include "Exception.h"
#include <string.h>
#include <cxxabi.h>
#include <Poco/String.h>
#include <common/logger_useful.h>
#include <IO/WriteHelpers.h>
#include <IO/Operators.h>
#include <IO/ReadBufferFromString.h>
#include <Common/Exception.h>
#include <common/demangle.h>
#include <Common/config_version.h>
namespace
DB
{
...
...
@@ -24,6 +21,10 @@ namespace ErrorCodes
extern
const
int
CANNOT_TRUNCATE_FILE
;
}
const
char
*
getVersion
()
{
return
VERSION_STRING
;
}
std
::
string
errnoToString
(
int
code
,
int
e
)
{
...
...
@@ -81,13 +82,13 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
}
catch
(
const
Exception
&
e
)
{
stream
<<
getExceptionMessage
(
e
,
with_stacktrace
,
check_embedded_stacktrace
);
stream
<<
"("
<<
getVersion
()
<<
") "
<<
getExceptionMessage
(
e
,
with_stacktrace
,
check_embedded_stacktrace
);
}
catch
(
const
Poco
::
Exception
&
e
)
{
try
{
stream
<<
"Poco::Exception. Code: "
<<
ErrorCodes
::
POCO_EXCEPTION
<<
", e.code() = "
<<
e
.
code
()
stream
<<
"
("
<<
getVersion
()
<<
") "
<<
"
Poco::Exception. Code: "
<<
ErrorCodes
::
POCO_EXCEPTION
<<
", e.code() = "
<<
e
.
code
()
<<
", e.displayText() = "
<<
e
.
displayText
();
}
catch
(...)
{}
...
...
@@ -102,7 +103,7 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
if
(
status
)
name
+=
" (demangling status: "
+
toString
(
status
)
+
")"
;
stream
<<
"std::exception. Code: "
<<
ErrorCodes
::
STD_EXCEPTION
<<
", type: "
<<
name
<<
", e.what() = "
<<
e
.
what
();
stream
<<
"
("
<<
getVersion
()
<<
") "
<<
"
std::exception. Code: "
<<
ErrorCodes
::
STD_EXCEPTION
<<
", type: "
<<
name
<<
", e.what() = "
<<
e
.
what
();
}
catch
(...)
{}
}
...
...
@@ -116,7 +117,7 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
if
(
status
)
name
+=
" (demangling status: "
+
toString
(
status
)
+
")"
;
stream
<<
"Unknown exception. Code: "
<<
ErrorCodes
::
UNKNOWN_EXCEPTION
<<
", type: "
<<
name
;
stream
<<
"
("
<<
getVersion
()
<<
") "
<<
"
Unknown exception. Code: "
<<
ErrorCodes
::
UNKNOWN_EXCEPTION
<<
", type: "
<<
name
;
}
catch
(...)
{}
}
...
...
libs/libdaemon/src/BaseDaemon.cpp
浏览文件 @
7d1be03a
#include <daemon/BaseDaemon.h>
#include <daemon/OwnFormattingChannel.h>
#include <daemon/OwnPatternFormatter.h>
#include <Common/Config/ConfigProcessor.h>
#include <daemon/OwnSplitChannel.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
...
...
@@ -15,18 +13,6 @@
#include <cxxabi.h>
#include <execinfo.h>
#include <unistd.h>
#if USE_UNWIND
#define UNW_LOCAL_ONLY
#include <libunwind.h>
#endif
#ifdef __APPLE__
// ucontext is not available without _XOPEN_SOURCE
#define _XOPEN_SOURCE
#endif
#include <ucontext.h>
#include <typeinfo>
#include <common/logger_useful.h>
#include <common/ErrorHandlers.h>
...
...
@@ -68,6 +54,18 @@
#include <Common/CurrentThread.h>
#include <Poco/Net/RemoteSyslogChannel.h>
#if USE_UNWIND
#define UNW_LOCAL_ONLY
#include <libunwind.h>
#endif
#ifdef __APPLE__
// ucontext is not available without _XOPEN_SOURCE
#define _XOPEN_SOURCE
#endif
#include <ucontext.h>
/** For transferring information from signal handler to a separate thread.
* If you need to do something serious in case of a signal (example: write a message to the log),
* then sending information to a separate thread through pipe and doing all the stuff asynchronously
...
...
@@ -301,13 +299,13 @@ private:
private:
void
onTerminate
(
const
std
::
string
&
message
,
ThreadNumber
thread_num
)
const
{
LOG_ERROR
(
log
,
"(from thread "
<<
thread_num
<<
") "
<<
message
);
LOG_ERROR
(
log
,
"(
"
<<
VERSION_STRING
<<
") (
from thread "
<<
thread_num
<<
") "
<<
message
);
}
void
onFault
(
int
sig
,
siginfo_t
&
info
,
ucontext_t
&
context
,
ThreadNumber
thread_num
)
const
{
LOG_ERROR
(
log
,
"########################################"
);
LOG_ERROR
(
log
,
"(from thread "
<<
thread_num
<<
") "
LOG_ERROR
(
log
,
"(
"
<<
VERSION_STRING
<<
") (
from thread "
<<
thread_num
<<
") "
<<
"Received signal "
<<
strsignal
(
sig
)
<<
" ("
<<
sig
<<
")"
<<
"."
);
void
*
caller_address
=
nullptr
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录