Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
KASAKI11
TDengine
提交
a2851a56
T
TDengine
项目概览
KASAKI11
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a2851a56
编写于
8月 04, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
8月 04, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2921 from taosdata/bugfix/coverity
fix some coverity issues
上级
8cffe8f2
ac8c6e06
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
21 deletion
+29
-21
src/client/src/tscStream.c
src/client/src/tscStream.c
+8
-7
src/client/src/tscSub.c
src/client/src/tscSub.c
+1
-0
src/dnode/src/dnodeTelemetry.c
src/dnode/src/dnodeTelemetry.c
+20
-14
未找到文件。
src/client/src/tscStream.c
浏览文件 @
a2851a56
...
...
@@ -220,15 +220,16 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
&
pSql
->
cmd
,
0
,
0
);
if
(
numOfRows
>
0
)
{
// when reaching here the first execution of stream computing is successful.
pStream
->
numOfRes
+=
numOfRows
;
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
++
i
)
{
TAOS_ROW
row
=
taos_fetch_row
(
res
);
tscDebug
(
"%p stream:%p fetch result"
,
pSql
,
pStream
);
tscStreamFillTimeGap
(
pStream
,
*
(
TSKEY
*
)
row
[
0
]);
pStream
->
stime
=
*
(
TSKEY
*
)
row
[
0
];
// user callback function
(
*
pStream
->
fp
)(
pStream
->
param
,
res
,
row
);
if
(
row
!=
NULL
)
{
tscDebug
(
"%p stream:%p fetch result"
,
pSql
,
pStream
);
tscStreamFillTimeGap
(
pStream
,
*
(
TSKEY
*
)
row
[
0
]);
pStream
->
stime
=
*
(
TSKEY
*
)
row
[
0
];
// user callback function
(
*
pStream
->
fp
)(
pStream
->
param
,
res
,
row
);
pStream
->
numOfRes
++
;
}
}
if
(
!
pStream
->
isProject
)
{
...
...
src/client/src/tscSub.c
浏览文件 @
a2851a56
...
...
@@ -203,6 +203,7 @@ static void tscProcessSubscriptionTimer(void *handle, void *tmrId) {
static
SArray
*
getTableList
(
SSqlObj
*
pSql
)
{
const
char
*
p
=
strstr
(
pSql
->
sqlstr
,
" from "
);
assert
(
p
!=
NULL
);
// we are sure this is a 'select' statement
char
*
sql
=
alloca
(
strlen
(
p
)
+
32
);
sprintf
(
sql
,
"select tbid(tbname)%s"
,
p
);
...
...
src/dnode/src/dnodeTelemetry.c
浏览文件 @
a2851a56
...
...
@@ -33,7 +33,7 @@ static pthread_t tsTelemetryThread;
#define TELEMETRY_SERVER "telemetry.taosdata.com"
#define TELEMETRY_PORT 80
#define REPORT_INTERVAL 86400
#define REPORT_INTERVAL 86400
static
void
beginObject
(
SBufferWriter
*
bw
)
{
tbufWriteChar
(
bw
,
'{'
);
...
...
@@ -220,28 +220,34 @@ static void sendTelemetryReport() {
taosWriteSocket
(
fd
,
tbufGetData
(
&
bw
,
false
),
contLen
);
tbufCloseWriter
(
&
bw
);
taosReadSocket
(
fd
,
buf
,
10
);
// read something to avoid nginx error 499
// read something to avoid nginx error 499
if
(
taosReadSocket
(
fd
,
buf
,
10
)
<
0
)
{
dTrace
(
"failed to receive response, reason:%s"
,
strerror
(
errno
));
}
taosCloseSocket
(
fd
);
}
static
void
*
telemetryThread
(
void
*
param
)
{
int
timeToWait
=
0
;
struct
timespec
end
=
{
0
};
clock_gettime
(
CLOCK_REALTIME
,
&
end
);
end
.
tv_sec
+=
300
;
// wait 5 minutes to send first report
while
(
1
)
{
if
(
timeToWait
<=
0
)
{
if
(
sdbIsMaster
())
{
sendTelemetryReport
();
while
(
1
)
{
if
(
sem_timedwait
(
&
tsExitSem
,
&
end
)
==
0
)
{
return
NULL
;
}
struct
timespec
now
=
{
0
};
clock_gettime
(
CLOCK_REALTIME
,
&
now
);
if
(
now
.
tv_sec
>
end
.
tv_sec
||
(
now
.
tv_sec
==
end
.
tv_sec
&&
now
.
tv_nsec
>=
end
.
tv_nsec
))
{
break
;
}
timeToWait
=
REPORT_INTERVAL
;
}
int
startAt
=
taosGetTimestampSec
();
struct
timespec
timeout
=
{.
tv_sec
=
0
,
.
tv_nsec
=
0
};
clock_gettime
(
CLOCK_REALTIME
,
&
timeout
);
timeout
.
tv_sec
+=
timeToWait
;
if
(
sem_timedwait
(
&
tsExitSem
,
&
timeout
)
==
0
)
{
break
;
if
(
sdbIsMaster
())
{
sendTelemetryReport
();
}
timeToWait
-=
(
taosGetTimestampSec
()
-
startAt
)
;
end
.
tv_sec
+=
REPORT_INTERVAL
;
}
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录