Skip to content

Commit

Permalink
Merge pull request #1 from apache/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
jackieha committed Aug 12, 2019
2 parents e74637a + 45a2196 commit c5d69c3
Show file tree
Hide file tree
Showing 232 changed files with 838 additions and 977 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ packages/
OALLexer.tokens
.factorypath
.vscode
.checkstyle
.externalToolBuilders
7 changes: 7 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ pipeline {
sh './mvnw javadoc:javadoc -Dmaven.test.skip=true'
}
}

stage('Check Dependencies Licenses') {
steps {
sh 'tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist'
sh 'tools/dependencies/check-LICENSE.sh'
}
}
}

post {
Expand Down
2 changes: 1 addition & 1 deletion apm-application-toolkit/apm-toolkit-log4j-1.x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apm-application-toolkit</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apm-application-toolkit</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-application-toolkit/apm-toolkit-logback-1.x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apm-application-toolkit</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-application-toolkit/apm-toolkit-opentracing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apm-application-toolkit</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-application-toolkit/apm-toolkit-trace/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>apm-application-toolkit</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-application-toolkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>apm</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apm-application-toolkit</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion apm-commons/apm-datacarrier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apm-commons</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-commons/apm-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>apm-commons</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>apm</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apm</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion apm-dist/release-docs/LICENSE
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ The text of each license is the standard Apache 2.0 license.
Apache: commons-io 2.4: https://github.com/apache/commons-io, Apache 2.0
Apache: commons-compress 1.18: https://github.com/apache/commons-compress, Apache 2.0
Apache: tomcat 8.5.27: https://github.com/apache/tomcat/tree/trunk, Apache 2.0
Apache: freemaker 2.3.28: https://github.com/apache/freemarker, Apache 2.0
Apache: freemarker 2.3.28: https://github.com/apache/freemarker, Apache 2.0
netty 5.5.0: https://github.com/netty/netty/blob/4.1/LICENSE.txt, Apache 2.0
annotations 13.0: http://www.jetbrains.org, Apache 2.0
compiler 0.9.3: https://github.com/spullara/mustache.java, Apache 2.0
Expand Down
Empty file modified apm-dist/release-docs/NOTICE
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion apm-protocol/apm-network/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apm-protocol</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
64 changes: 0 additions & 64 deletions ...ork/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -127,68 +127,4 @@ public class ComponentsDefine {
public static final OfficialComponent SPRING_ASYNC = new OfficialComponent(65, "SpringAsync");

public static final OfficialComponent JDK_HTTP = new OfficialComponent(66, "JdkHttp");

private static ComponentsDefine INSTANCE = new ComponentsDefine();

private String[] components;

public static ComponentsDefine getInstance() {
return INSTANCE;
}

public ComponentsDefine() {
components = new String[100];
addComponent(TOMCAT);
addComponent(HTTPCLIENT);
addComponent(DUBBO);
addComponent(MOTAN);
addComponent(RESIN);
addComponent(FEIGN);
addComponent(OKHTTP);
addComponent(SPRING_REST_TEMPLATE);
addComponent(SPRING_MVC_ANNOTATION);
addComponent(STRUTS2);
addComponent(NUTZ_MVC_ANNOTATION);
addComponent(NUTZ_HTTP);
addComponent(JETTY_CLIENT);
addComponent(JETTY_SERVER);
addComponent(SHARDING_JDBC);
addComponent(SHARDING_SPHERE);
addComponent(GRPC);
addComponent(ELASTIC_JOB);
addComponent(HTTP_ASYNC_CLIENT);
addComponent(SERVICECOMB);
addComponent(HYSTRIX);
addComponent(H2_JDBC_DRIVER);
addComponent(MYSQL_JDBC_DRIVER);
addComponent(OJDBC);
addComponent(JEDIS);
addComponent(SPYMEMCACHED);
addComponent(XMEMCACHED);
addComponent(POSTGRESQL_DRIVER);
addComponent(ROCKET_MQ_PRODUCER);
addComponent(ROCKET_MQ_CONSUMER);
addComponent(KAFKA_PRODUCER);
addComponent(KAFKA_CONSUMER);
addComponent(MONGO_DRIVER);
addComponent(SOFARPC);
addComponent(ACTIVEMQ_PRODUCER);
addComponent(ACTIVEMQ_CONSUMER);
addComponent(UNDERTOW);
addComponent(RABBITMQ_PRODUCER);
addComponent(RABBITMQ_CONSUMER);
addComponent(CANAL);
addComponent(GSON);
addComponent(REDISSON);
addComponent(LETTUCE);
addComponent(ZOOKEEPER);
addComponent(VERTX);
addComponent(SPRING_CLOUD_GATEWAY);
addComponent(RESTEASY);
addComponent(SOLRJ);
}

private void addComponent(OfficialComponent component) {
components[component.getId()] = component.getName();
}
}
2 changes: 1 addition & 1 deletion apm-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>apm</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
34 changes: 12 additions & 22 deletions apm-sniffer/apm-agent-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
~
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>apm-sniffer</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>

<artifactId>apm-agent-core</artifactId>
Expand Down Expand Up @@ -212,8 +211,7 @@
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
</configuration>
</execution>
Expand All @@ -229,7 +227,7 @@
</goals>
<configuration>
<tasks>
<delete dir="${project.basedir}/../../packages"/>
<delete dir="${project.basedir}/../../packages" />
</tasks>
</configuration>
</execution>
Expand All @@ -238,22 +236,14 @@
<phase>package</phase>
<configuration>
<target>
<echo message="unjar"/>
<unzip src="${project.build.directory}/${project.artifactId}-${project.version}.jar"
dest="${project.build.directory}/unpacked/"/>
<echo message="rename service providers in META-INF/services"/>
<move
file="${project.build.directory}/unpacked/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib"
tofile="${project.build.directory}/unpacked/META-INF/native/liborg_apache_skywalking_apm_dependencies_netty_tcnative_osx_x86_64.jnilib"/>
<move
file="${project.build.directory}/unpacked/META-INF/native/libnetty_tcnative_linux_x86_64.so"
tofile="${project.build.directory}/unpacked/META-INF/native/liborg_apache_skywalking_apm_dependencies_netty_tcnative_linux_x86_64.so"/>
<move
file="${project.build.directory}/unpacked/META-INF/native/netty_tcnative_windows_x86_64.dll"
tofile="${project.build.directory}/unpacked/META-INF/native/org_apache_skywalking_apm_dependencies_netty_tcnative_windows_x86_64.dll"/>
<echo message="jar back"/>
<jar destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"
basedir="${project.build.directory}/unpacked"/>
<echo message="unjar" />
<unzip src="${project.build.directory}/${project.artifactId}-${project.version}.jar" dest="${project.build.directory}/unpacked/" />
<echo message="rename service providers in META-INF/services" />
<move file="${project.build.directory}/unpacked/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib" tofile="${project.build.directory}/unpacked/META-INF/native/liborg_apache_skywalking_apm_dependencies_netty_tcnative_osx_x86_64.jnilib" />
<move file="${project.build.directory}/unpacked/META-INF/native/libnetty_tcnative_linux_x86_64.so" tofile="${project.build.directory}/unpacked/META-INF/native/liborg_apache_skywalking_apm_dependencies_netty_tcnative_linux_x86_64.so" />
<move file="${project.build.directory}/unpacked/META-INF/native/netty_tcnative_windows_x86_64.dll" tofile="${project.build.directory}/unpacked/META-INF/native/org_apache_skywalking_apm_dependencies_netty_tcnative_windows_x86_64.dll" />
<echo message="jar back" />
<jar destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar" basedir="${project.build.directory}/unpacked" />
</target>
</configuration>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ public static class Agent {
* after receiving reset command
*/
public static int COOL_DOWN_THRESHOLD = 10;

/**
* Force reconnection period of grpc, based on grpc_channel_check_interval.
* If count of check grpc channel status more than this number.
* The channel check will call channel.getState(true) to requestConnection.
*/
public static long FORCE_RECONNECTION_PERIOD = 1;
}

public static class Collector {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ public abstract class AbstractTracingSpan implements AbstractSpan {
protected String operationName;
protected int operationId;
protected SpanLayer layer;
protected boolean isInAsyncMode = false;
/**
* The span has been tagged in async mode, required async stop to finish.
*/
protected volatile boolean isInAsyncMode = false;
/**
* The flag represents whether the span has been async stopped
*/
private volatile boolean isAsyncStopped = false;
protected volatile AbstractTracerContext context;

/**
Expand Down Expand Up @@ -322,6 +329,9 @@ public SpanObjectV2.Builder transform() {
}

@Override public AbstractSpan prepareForAsync() {
if (isInAsyncMode) {
throw new RuntimeException("Prepare for async repeatedly. Span is already in async mode.");
}
context = ContextManager.awaitFinishAsync(this);
isInAsyncMode = true;
return this;
Expand All @@ -331,9 +341,12 @@ public SpanObjectV2.Builder transform() {
if (!isInAsyncMode) {
throw new RuntimeException("Span is not in async mode, please use '#prepareForAsync' to active.");
}

if (isAsyncStopped) {
throw new RuntimeException("Can not do async finish for the span repeately.");
}
this.endTime = System.currentTimeMillis();
context.asyncStop(this);
isAsyncStopped = true;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ public boolean isShutdown() {
}

public boolean isConnected() {
return originChannel.getState(false) == ConnectivityState.READY;
return isConnected(false);
}

public boolean isConnected(boolean requestConnection) {
return originChannel.getState(requestConnection) == ConnectivityState.READY;
}

public static class Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class GRPCChannelManager implements BootService, Runnable {
private List<GRPCChannelListener> listeners = Collections.synchronizedList(new LinkedList<GRPCChannelListener>());
private volatile List<String> grpcServers;
private volatile int selectedIdx = -1;
private volatile int reconnectCount = 0;

@Override
public void prepare() throws Throwable {
Expand Down Expand Up @@ -115,13 +116,14 @@ public void run() {
.addChannelDecorator(new AgentIDDecorator())
.addChannelDecorator(new AuthenticationDecorator())
.build();

notify(GRPCChannelStatus.CONNECTED);
reconnectCount = 0;
reconnect = false;
} else if (managedChannel.isConnected()) {
} else if (managedChannel.isConnected(++reconnectCount > Config.Agent.FORCE_RECONNECTION_PERIOD)) {
// Reconnect to the same server is automatically done by GRPC,
// therefore we are responsible to check the connectivity and
// set the state and notify listeners
reconnectCount = 0;
notify(GRPCChannelStatus.CONNECTED);
reconnect = false;
}
Expand Down Expand Up @@ -168,7 +170,7 @@ private void notify(GRPCChannelStatus status) {

private boolean isNetworkError(Throwable throwable) {
if (throwable instanceof StatusRuntimeException) {
StatusRuntimeException statusRuntimeException = (StatusRuntimeException)throwable;
StatusRuntimeException statusRuntimeException = (StatusRuntimeException) throwable;
return statusEquals(statusRuntimeException.getStatus(),
Status.UNAVAILABLE,
Status.PERMISSION_DENIED,
Expand Down
Loading

0 comments on commit c5d69c3

Please sign in to comment.