Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gdyjdao
SkyWalking
提交
1b83b344
S
SkyWalking
项目概览
gdyjdao
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
1b83b344
编写于
6月 10, 2018
作者:
wu-sheng
提交者:
GitHub
6月 10, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Relied on grpc response for certain, to avoid OOM when collector is overloaded. (#1323)
上级
0f0b56db
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
7 deletion
+26
-7
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/GRPCStreamServiceStatus.java
...alking/apm/agent/core/remote/GRPCStreamServiceStatus.java
+23
-1
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/TraceSegmentServiceClient.java
...king/apm/agent/core/remote/TraceSegmentServiceClient.java
+3
-6
未找到文件。
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/GRPCStreamServiceStatus.java
浏览文件 @
1b83b344
...
...
@@ -16,13 +16,16 @@
*
*/
package
org.apache.skywalking.apm.agent.core.remote
;
import
org.apache.skywalking.apm.agent.core.logging.api.ILog
;
import
org.apache.skywalking.apm.agent.core.logging.api.LogManager
;
/**
* @author wusheng
*/
public
class
GRPCStreamServiceStatus
{
private
static
final
ILog
logger
=
LogManager
.
getLogger
(
GRPCStreamServiceStatus
.
class
);
private
volatile
boolean
status
;
public
GRPCStreamServiceStatus
(
boolean
status
)
{
...
...
@@ -52,6 +55,25 @@ public class GRPCStreamServiceStatus {
return
status
;
}
/**
* Wait until success status reported.
*/
public
void
wait4Finish
()
{
long
recheckCycle
=
5
;
long
hasWaited
=
0L
;
long
maxCycle
=
30
*
1000L
;
// 30 seconds max.
while
(!
status
)
{
try2Sleep
(
recheckCycle
);
hasWaited
+=
recheckCycle
;
if
(
recheckCycle
>=
maxCycle
)
{
logger
.
warn
(
"Collector traceSegment service doesn't response in {} seconds."
,
hasWaited
);
}
else
{
recheckCycle
=
recheckCycle
*
2
>
maxCycle
?
maxCycle
:
recheckCycle
*
2
;
}
}
}
/**
* Try to sleep, and ignore the {@link InterruptedException}
*
...
...
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/TraceSegmentServiceClient.java
浏览文件 @
1b83b344
...
...
@@ -16,11 +16,11 @@
*
*/
package
org.apache.skywalking.apm.agent.core.remote
;
import
io.grpc.Channel
;
import
io.grpc.stub.StreamObserver
;
import
java.util.List
;
import
org.apache.skywalking.apm.agent.core.boot.BootService
;
import
org.apache.skywalking.apm.agent.core.boot.DefaultImplementor
;
import
org.apache.skywalking.apm.agent.core.boot.ServiceManager
;
...
...
@@ -36,8 +36,6 @@ import org.apache.skywalking.apm.network.proto.Downstream;
import
org.apache.skywalking.apm.network.proto.TraceSegmentServiceGrpc
;
import
org.apache.skywalking.apm.network.proto.UpstreamSegment
;
import
java.util.List
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
conf
.
Config
.
Buffer
.
BUFFER_SIZE
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
conf
.
Config
.
Buffer
.
CHANNEL_SIZE
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
remote
.
GRPCChannelStatus
.
CONNECTED
;
...
...
@@ -122,9 +120,8 @@ public class TraceSegmentServiceClient implements BootService, IConsumer<TraceSe
}
upstreamSegmentStreamObserver
.
onCompleted
();
if
(
status
.
wait4Finish
(
TIMEOUT
))
{
segmentUplinkedCounter
+=
data
.
size
();
}
status
.
wait4Finish
();
segmentUplinkedCounter
+=
data
.
size
();
}
else
{
segmentAbandonedCounter
+=
data
.
size
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录