From c3f668bfdf04aa44909ce78da0dd709be65e9e8b Mon Sep 17 00:00:00 2001 From: koo-taejin Date: Tue, 16 Sep 2014 20:11:54 +0900 Subject: [PATCH] =?UTF-8?q?#5=20Pinpoint=20=ED=81=B4=EB=9F=AC=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=20=EA=B0=9C=EB=B0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pinpoint/collector/cluster/ClusterPointRouter.java | 6 ++++++ .../pinpoint/collector/cluster/ProfilerClusterPoint.java | 2 +- .../navercorp/pinpoint/thrift/io/TCommandTypeVersion.java | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/collector/src/main/java/com/navercorp/pinpoint/collector/cluster/ClusterPointRouter.java b/collector/src/main/java/com/navercorp/pinpoint/collector/cluster/ClusterPointRouter.java index f4f491824..1dfb7b05a 100644 --- a/collector/src/main/java/com/navercorp/pinpoint/collector/cluster/ClusterPointRouter.java +++ b/collector/src/main/java/com/navercorp/pinpoint/collector/cluster/ClusterPointRouter.java @@ -128,6 +128,12 @@ public class ClusterPointRouter { TBase command = deserialize(payload); ChannelContext channelContext = profilerClusterPoint.getChannelContext(applicationName, agentId, -1); + if (channelContext == null) { + TResult result = new TResult(false); + result.setMessage(applicationName + "/" + agentId + " can't find suitable ChannelContext."); + channel.write(new ResponsePacket(requestPacket.getRequestId(), serialize(result))); + return; + } Map proeprties = channelContext.getChannelProperties(); String version = MapUtils.getString(proeprties, AgentPropertiesType.VERSION.getName()); diff --git a/collector/src/main/java/com/navercorp/pinpoint/collector/cluster/ProfilerClusterPoint.java b/collector/src/main/java/com/navercorp/pinpoint/collector/cluster/ProfilerClusterPoint.java index b8bd0d901..82921c075 100644 --- a/collector/src/main/java/com/navercorp/pinpoint/collector/cluster/ProfilerClusterPoint.java +++ b/collector/src/main/java/com/navercorp/pinpoint/collector/cluster/ProfilerClusterPoint.java @@ -75,7 +75,7 @@ public class ProfilerClusterPoint implements ClusterPoint { if (startTimestamp <= 0) { // Fix Me // startTimestamp도 체크하게 변경해야함 - return false; + return true; } return true; diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/io/TCommandTypeVersion.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/io/TCommandTypeVersion.java index 00b1f0f35..628986ed4 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/io/TCommandTypeVersion.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/io/TCommandTypeVersion.java @@ -50,7 +50,11 @@ public enum TCommandTypeVersion { } for (TCommandType eachCommand : supportCommandList) { - if (command.getClass().isInstance(eachCommand)) { + if (eachCommand == null) { + continue; + } + + if (eachCommand.getClazz() == command.getClass()) { return true; } }