提交 07e799e4 编写于 作者: wu-sheng's avatar wu-sheng 提交者: 彭勇升 pengys

Fix bugs (#1854)

* Avoid service inventory object concurrency situation.

* Fix concurrency for minute persistence and others

* Fix document todo.

* Update license. Fix package with dirty agent plugin jar files.

* Fixed not combine error in persistence register worker.
上级 279c81e9
...@@ -225,15 +225,15 @@ Apache 2.0 licenses ...@@ -225,15 +225,15 @@ Apache 2.0 licenses
The following components are provided under the Apache License. See project link for details. The following components are provided under the Apache License. See project link for details.
The text of each license is the standard Apache 2.0 license. The text of each license is the standard Apache 2.0 license.
raphw (byte-buddy) 1.7.9: http://bytebuddy.net/ , Apache 2.0 raphw (byte-buddy) 1.9.2: http://bytebuddy.net/ , Apache 2.0
Google: grpc 1.8.0: https://grpc.io/ , Apache 2.0 Google: grpc 1.10.0: https://grpc.io/ , Apache 2.0
Google: gprc-java 1.8.0: https://github.com/grpc/grpc-java, Apache 2.0 Google: gprc-java 1.10.0: https://github.com/grpc/grpc-java, Apache 2.0
Google: guava 19.0: https://github.com/google/guava , Apache 2.0 Google: guava 19.0: https://github.com/google/guava , Apache 2.0
Google: gson 2.8.1: https://github.com/google/gson , Apache 2.0 Google: gson 2.8.1: https://github.com/google/gson , Apache 2.0
Google: opencensus-java 0.8.0: https://github.com/census-instrumentation/opencensus-java , Apache 2.0 Google: opencensus-java 0.8.0: https://github.com/census-instrumentation/opencensus-java , Apache 2.0
Google: proto-google-common-protos 0.1.9: https://github.com/googleapis/googleapis , Apache 2.0 Google: proto-google-common-protos 0.1.9: https://github.com/googleapis/googleapis , Apache 2.0
Google: jsr305 3.0.0: http://central.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.pom , Apache 2.0 Google: jsr305 3.0.0: http://central.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.pom , Apache 2.0
Elasticsearch BV (Elasticsearch) 5.5.0: https://www.elastic.co/products/elasticsearch , Apache 2.0 Elasticsearch BV (Elasticsearch) 6.3.2: https://www.elastic.co/products/elasticsearch , Apache 2.0
lang-mustache-client 5.5.0: https://github.com/elastic/elasticsearch/tree/master/modules/lang-mustache , Apache 2.0 lang-mustache-client 5.5.0: https://github.com/elastic/elasticsearch/tree/master/modules/lang-mustache , Apache 2.0
parent-join-client 5.5.0: https://github.com/elastic/elasticsearch/tree/master/modules/parent-join , Apache 2.0 parent-join-client 5.5.0: https://github.com/elastic/elasticsearch/tree/master/modules/parent-join , Apache 2.0
reindex-client 5.5.0: https://github.com/elastic/elasticsearch/tree/master/modules/reindex , Apache 2.0 reindex-client 5.5.0: https://github.com/elastic/elasticsearch/tree/master/modules/reindex , Apache 2.0
......
...@@ -103,6 +103,7 @@ ...@@ -103,6 +103,7 @@
</goals> </goals>
<configuration> <configuration>
<tasks> <tasks>
<delete dir="${project.basedir}/../../skywalking-agent" />
<mkdir dir="${project.basedir}/../../skywalking-agent" /> <mkdir dir="${project.basedir}/../../skywalking-agent" />
<copy file="${project.build.directory}/skywalking-agent.jar" tofile="${project.basedir}/../../skywalking-agent/skywalking-agent.jar" overwrite="true" /> <copy file="${project.build.directory}/skywalking-agent.jar" tofile="${project.basedir}/../../skywalking-agent/skywalking-agent.jar" overwrite="true" />
<mkdir dir="${project.basedir}/../../skywalking-agent/config" /> <mkdir dir="${project.basedir}/../../skywalking-agent/config" />
......
...@@ -38,7 +38,3 @@ cluster: ...@@ -38,7 +38,3 @@ cluster:
labelSelector: app=collector,release=skywalking labelSelector: app=collector,release=skywalking
uidEnvName: SKYWALKING_COLLECTOR_UID uidEnvName: SKYWALKING_COLLECTOR_UID
``` ```
TODO @hanahmily
settings descriptions.
\ No newline at end of file
...@@ -48,9 +48,6 @@ public class IndicatorTransWorker extends AbstractWorker<Indicator> { ...@@ -48,9 +48,6 @@ public class IndicatorTransWorker extends AbstractWorker<Indicator> {
} }
@Override public void in(Indicator indicator) { @Override public void in(Indicator indicator) {
if (Objects.nonNull(minutePersistenceWorker)) {
minutePersistenceWorker.in(indicator);
}
if (Objects.nonNull(hourPersistenceWorker)) { if (Objects.nonNull(hourPersistenceWorker)) {
hourPersistenceWorker.in(indicator.toHour()); hourPersistenceWorker.in(indicator.toHour());
} }
...@@ -60,5 +57,12 @@ public class IndicatorTransWorker extends AbstractWorker<Indicator> { ...@@ -60,5 +57,12 @@ public class IndicatorTransWorker extends AbstractWorker<Indicator> {
if (Objects.nonNull(monthPersistenceWorker)) { if (Objects.nonNull(monthPersistenceWorker)) {
monthPersistenceWorker.in(indicator.toMonth()); monthPersistenceWorker.in(indicator.toMonth());
} }
/**
* Minute persistent must be at the end of all time dimensionalities
* Because #toHour, #toDay, #toMonth include clone inside, which could avoid concurrency situation.
*/
if (Objects.nonNull(minutePersistenceWorker)) {
minutePersistenceWorker.in(indicator);
}
} }
} }
...@@ -76,6 +76,20 @@ public class ServiceInventory extends RegisterSource { ...@@ -76,6 +76,20 @@ public class ServiceInventory extends RegisterSource {
return result; return result;
} }
public ServiceInventory getClone() {
ServiceInventory inventory = new ServiceInventory();
inventory.setSequence(getSequence());
inventory.setRegisterTime(getRegisterTime());
inventory.setHeartbeatTime(getHeartbeatTime());
inventory.setName(name);
inventory.setIsAddress(isAddress);
inventory.setAddressId(addressId);
inventory.setMappingLastUpdateTime(mappingLastUpdateTime);
inventory.setMappingServiceId(mappingServiceId);
return inventory;
}
@Override public boolean equals(Object obj) { @Override public boolean equals(Object obj) {
if (this == obj) if (this == obj)
return true; return true;
......
...@@ -103,6 +103,7 @@ public class ServiceInventoryRegister implements IServiceInventoryRegister { ...@@ -103,6 +103,7 @@ public class ServiceInventoryRegister implements IServiceInventoryRegister {
@Override public void updateMapping(int serviceId, int mappingServiceId) { @Override public void updateMapping(int serviceId, int mappingServiceId) {
ServiceInventory serviceInventory = getServiceInventoryCache().get(serviceId); ServiceInventory serviceInventory = getServiceInventoryCache().get(serviceId);
if (Objects.nonNull(serviceInventory)) { if (Objects.nonNull(serviceInventory)) {
serviceInventory = serviceInventory.getClone();
serviceInventory.setMappingServiceId(mappingServiceId); serviceInventory.setMappingServiceId(mappingServiceId);
serviceInventory.setMappingLastUpdateTime(System.currentTimeMillis()); serviceInventory.setMappingLastUpdateTime(System.currentTimeMillis());
......
...@@ -22,7 +22,7 @@ import java.util.*; ...@@ -22,7 +22,7 @@ import java.util.*;
import org.apache.skywalking.apm.commons.datacarrier.DataCarrier; import org.apache.skywalking.apm.commons.datacarrier.DataCarrier;
import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer; import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer;
import org.apache.skywalking.oap.server.core.analysis.data.EndOfBatchContext; import org.apache.skywalking.oap.server.core.analysis.data.EndOfBatchContext;
import org.apache.skywalking.oap.server.core.register.*; import org.apache.skywalking.oap.server.core.register.RegisterSource;
import org.apache.skywalking.oap.server.core.source.Scope; import org.apache.skywalking.oap.server.core.source.Scope;
import org.apache.skywalking.oap.server.core.storage.*; import org.apache.skywalking.oap.server.core.storage.*;
import org.apache.skywalking.oap.server.core.worker.AbstractWorker; import org.apache.skywalking.oap.server.core.worker.AbstractWorker;
...@@ -63,6 +63,8 @@ public class RegisterPersistentWorker extends AbstractWorker<RegisterSource> { ...@@ -63,6 +63,8 @@ public class RegisterPersistentWorker extends AbstractWorker<RegisterSource> {
private void onWork(RegisterSource registerSource) { private void onWork(RegisterSource registerSource) {
if (!sources.containsKey(registerSource)) { if (!sources.containsKey(registerSource)) {
sources.put(registerSource, registerSource); sources.put(registerSource, registerSource);
} else {
sources.get(registerSource).combine(registerSource);
} }
if (registerSource.getEndOfBatchContext().isEndOfBatch()) { if (registerSource.getEndOfBatchContext().isEndOfBatch()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册