Skip to content

Commit db21b8c

Browse files
committed
Merge remote-tracking branch 'mytang0/3.2' into service-payload
* mytang0/3.2: (33 commits) Fix conflict Update codecov config (apache#11580) Set timeout value to string (apache#11565) Skip mapping retry if metadata config is invalid (apache#11323) Fix stackoverflow in SerializeSecurityConfigurator (apache#11561) Revert clear response operation of timeoutfilter (apache#11562) Fix hessian2 serializable check (apache#11573) feat: fix oom (apache#11571) Enhance service discovery update interval (apache#11223) Metrics code opt: redundant, modifier, magic (apache#11553) Perfect some code (apache#11533) feat: dubbo provided by (apache#11390) Enhance serializable check option (apache#11460) Fix config absent when refresh (apache#11505) Enhance json util check (apache#11501) Fix the bug in LFUCache#put() method (apache#11538) Bump maven-assembly-plugin from 3.1.0 to 3.4.2 (apache#11547) Bump consul-api from 1.4.2 to 1.4.5 (apache#11545) Bump maven-core from 3.8.7 to 3.9.0 (apache#11546) Bump bytebuddy.version from 1.12.22 to 1.13.0 (apache#11548) ... # Conflicts: # dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvoker.java
2 parents 56a195e + 7a774d2 commit db21b8c

File tree

135 files changed

+2032
-4148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+2032
-4148
lines changed

.codecov.yml

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
# limitations under the License.
1515
#
1616
coverage:
17+
require_ci_to_pass: false
18+
notify:
19+
wait_for_ci: false
1720
status:
1821
# pull-requests only
1922
patch:

.github/workflows/build-and-test-pr.yml

+64-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
SHOW_ERROR_DETAIL: 1
1212
#multi-version size limit
1313
VERSIONS_LIMIT: 4
14+
JACOCO_ENABLE: true
1415
CANDIDATE_VERSIONS: '
1516
spring.version:4.3.30.RELEASE;
1617
spring-boot.version:1.5.22.RELEASE;
@@ -70,7 +71,14 @@ jobs:
7071
- name: "Build Dubbo with Maven"
7172
run: |
7273
cd ./dubbo
73-
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,rat,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
74+
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
75+
- name: "Pack class result"
76+
run: 7z a ${{ github.workspace }}/class.zip */target/classes/* -r
77+
- name: "Upload class result"
78+
uses: actions/upload-artifact@v3
79+
with:
80+
name: "class-file"
81+
path: ${{ github.workspace }}/class.zip
7482
- name: "Pack rat file if failure"
7583
if: failure()
7684
run: 7z a ${{ github.workspace }}/rat.zip *rat.txt -r
@@ -205,8 +213,11 @@ jobs:
205213
timeout-minutes: 70
206214
run: |
207215
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -DtrimStackTrace=false -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
208-
- name: "Upload coverage to Codecov"
209-
uses: codecov/codecov-action@v3
216+
- name: "Upload coverage result"
217+
uses: actions/upload-artifact@v3
218+
with:
219+
name: coverage-result
220+
path: "**/target/site/**/jacoco.xml"
210221

211222
integration-test-prepare:
212223
runs-on: ubuntu-latest
@@ -279,6 +290,14 @@ jobs:
279290
cd test && bash ./build-test-image.sh
280291
- name: "Run tests"
281292
run: cd test && bash ./run-tests.sh
293+
- name: "merge jacoco resule"
294+
run: |
295+
cd test/dubbo-test-jacoco-merger && mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoMerge" -Dexec.args="${{github.workspace}}"
296+
- name: "Upload jacoco"
297+
uses: actions/upload-artifact@v3
298+
with:
299+
name: jacoco-result
300+
path: target/jacoco*.exec
282301
- name: "Upload test result"
283302
if: always()
284303
uses: actions/upload-artifact@v3
@@ -305,6 +324,48 @@ jobs:
305324
- name: "Merge test result"
306325
run: ./test/scripts/merge-test-results.sh
307326

327+
jacoco-result-merge:
328+
runs-on: ubuntu-latest
329+
needs: [integration-test-result, unit-test]
330+
steps:
331+
- uses: actions/checkout@v3
332+
with:
333+
path: "./dubbo"
334+
- uses: actions/checkout@v3
335+
with:
336+
repository: 'apache/dubbo-samples'
337+
path: "./dubbo-samples"
338+
- name: "Set up JDK 17"
339+
uses: actions/setup-java@v3
340+
with:
341+
distribution: 'zulu'
342+
java-version: 17
343+
- name: "Restore class result"
344+
uses: actions/download-artifact@v3
345+
with:
346+
name: "class-file"
347+
path: ${{ github.workspace }}
348+
- name: "Unpack class result"
349+
run: |
350+
cd ${{ github.workspace }}/dubbo
351+
unzip -o ${{ github.workspace }}/class.zip
352+
- name: "Restore jacoco exec"
353+
uses: actions/download-artifact@v3
354+
with:
355+
name: jacoco-result
356+
path: dubbo-samples/target/
357+
- name: "Merge jacoco result"
358+
run: |
359+
cd ${{ github.workspace }}/dubbo-samples/test/dubbo-test-jacoco-merger
360+
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-samples ${{github.workspace}}/dubbo"
361+
- name: "Restore coverage result"
362+
uses: actions/download-artifact@v3
363+
with:
364+
name: coverage-result
365+
path: dubbo/
366+
- name: "Upload coverage to Codecov"
367+
uses: codecov/codecov-action@v3
368+
308369
error-code-inspecting:
309370
runs-on: ubuntu-latest
310371
steps:

.github/workflows/build-and-test-scheduled-3.0.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,7 @@ jobs:
5050
- name: "Build Dubbo with Maven"
5151
run: |
5252
cd ./dubbo
53-
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,rat,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
54-
- name: "Pack rat file if failure"
55-
if: failure()
56-
run: 7z a ${{ github.workspace }}/rat.zip *rat.txt -r
57-
- name: "Upload rat file if failure"
58-
if: failure()
59-
uses: actions/upload-artifact@v3
60-
with:
61-
name: "rat-file"
62-
path: ${{ github.workspace }}/rat.zip
53+
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
6354
- name: "Pack checkstyle file if failure"
6455
if: failure()
6556
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r

.github/workflows/build-and-test-scheduled-3.1.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,7 @@ jobs:
6060
- name: "Build Dubbo with Maven"
6161
run: |
6262
cd ./dubbo
63-
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,rat,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
64-
- name: "Pack rat file if failure"
65-
if: failure()
66-
run: 7z a ${{ github.workspace }}/rat.zip *rat.txt -r
67-
- name: "Upload rat file if failure"
68-
if: failure()
69-
uses: actions/upload-artifact@v3
70-
with:
71-
name: "rat-file"
72-
path: ${{ github.workspace }}/rat.zip
63+
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
7364
- name: "Pack checkstyle file if failure"
7465
if: failure()
7566
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r

.github/workflows/build-and-test-scheduled-3.2.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,7 @@ jobs:
6060
- name: "Build Dubbo with Maven"
6161
run: |
6262
cd ./dubbo
63-
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,rat,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
64-
- name: "Pack rat file if failure"
65-
if: failure()
66-
run: 7z a ${{ github.workspace }}/rat.zip *rat.txt -r
67-
- name: "Upload rat file if failure"
68-
if: failure()
69-
uses: actions/upload-artifact@v3
70-
with:
71-
name: "rat-file"
72-
path: ${{ github.workspace }}/rat.zip
63+
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
7364
- name: "Pack checkstyle file if failure"
7465
if: failure()
7566
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r

.github/workflows/release-test.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,7 @@ jobs:
5858
- name: "Build Dubbo with Maven"
5959
run: |
6060
cd ./dubbo
61-
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,rat,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
62-
- name: "Pack rat file if failure"
63-
if: failure()
64-
run: 7z a ${{ github.workspace }}/rat.zip *rat.txt -r
65-
- name: "Upload rat file if failure"
66-
if: failure()
67-
uses: actions/upload-artifact@v2
68-
with:
69-
name: "rat-file"
70-
path: ${{ github.workspace }}/rat.zip
61+
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
7162
- name: "Pack checkstyle file if failure"
7263
if: failure()
7364
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r

dubbo-build-tools/pom.xml

-51
Original file line numberDiff line numberDiff line change
@@ -27,55 +27,4 @@
2727
<maven.deploy.skip>true</maven.deploy.skip>
2828
</properties>
2929

30-
<build>
31-
<plugins>
32-
<plugin>
33-
<groupId>org.apache.rat</groupId>
34-
<artifactId>apache-rat-plugin</artifactId>
35-
<version>0.15</version>
36-
<executions>
37-
<execution>
38-
<id>verify.rat</id>
39-
<phase>verify</phase>
40-
<goals>
41-
<goal>check</goal>
42-
</goals>
43-
</execution>
44-
</executions>
45-
<configuration>
46-
<excludes>
47-
<exclude>**/*.versionsBackup</exclude>
48-
<exclude>**/.idea/</exclude>
49-
<exclude>**/*.iml</exclude>
50-
<exclude>**/*.txt</exclude>
51-
<exclude>**/*.load</exclude>
52-
<exclude>**/*.flex</exclude>
53-
<exclude>**/*.fc</exclude>
54-
<exclude>**/*.javascript</exclude>
55-
<exclude>**/*.properties</exclude>
56-
<exclude>**/*.thrift</exclude>
57-
<exclude>**/*.sh</exclude>
58-
<exclude>**/*.bat</exclude>
59-
<exclude>**/*.md</exclude>
60-
<exclude>.git/</exclude>
61-
<exclude>.gitignore</exclude>
62-
<exclude>.repository/</exclude>
63-
<exclude>**/.settings/*</exclude>
64-
<exclude>**/.classpath</exclude>
65-
<exclude>**/.project</exclude>
66-
<exclude>**/target/**</exclude>
67-
<exclude>**/generated/**</exclude>
68-
<exclude>**/*.log</exclude>
69-
<exclude>CONTRIBUTING.md</exclude>
70-
<exclude>README.md</exclude>
71-
<exclude>**/codestyle/*</exclude>
72-
<exclude>**/resources/META-INF/**</exclude>
73-
<exclude>.github/**</exclude>
74-
<exclude>compiler/**</exclude>
75-
</excludes>
76-
</configuration>
77-
</plugin>
78-
</plugins>
79-
</build>
80-
8130
</project>

dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/MockDirInvocation.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ public void setAttachmentIfAbsent(String key, Object value) {
123123

124124
@Override
125125
public void setObjectAttachmentIfAbsent(String key, Object value) {
126-
if (attachments.get(key) == null) {
127-
attachments.put(key, value);
128-
}
126+
attachments.putIfAbsent(key, value);
129127
}
130128

131129
public Invoker<?> getInvoker() {

dubbo-common/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<artifactId>commons-logging</artifactId>
4343
<scope>provided</scope>
4444
</dependency>
45+
4546
<dependency>
4647
<groupId>log4j</groupId>
4748
<artifactId>log4j</artifactId>

dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
package org.apache.dubbo.common.constants;
1919

20+
import org.apache.dubbo.common.URL;
21+
2022
import java.net.NetworkInterface;
2123
import java.util.Properties;
2224
import java.util.concurrent.ExecutorService;
2325
import java.util.regex.Pattern;
2426

25-
import org.apache.dubbo.common.URL;
26-
2727
public interface CommonConstants {
2828
String DUBBO = "dubbo";
2929

@@ -365,7 +365,7 @@ public interface CommonConstants {
365365
/**
366366
* Whether to cache locally, default is true
367367
*/
368-
String REGISTRY_LOCAL_FILE_CACHE_ENABLED = "file.cache";
368+
String REGISTRY_LOCAL_FILE_CACHE_ENABLED = "file-cache";
369369

370370
String METADATA_INFO_CACHE_EXPIRE_KEY = "metadata-info-cache.expire";
371371

dubbo-common/src/main/java/org/apache/dubbo/common/constants/MetricsConstants.java

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public interface MetricsConstants {
2222

2323
String TAG_IP = "ip";
2424

25+
String TAG_PID = "pid";
26+
2527
String TAG_HOSTNAME = "hostname";
2628

2729
String TAG_APPLICATION_NAME = "application.name";
@@ -77,4 +79,6 @@ public interface MetricsConstants {
7779
String PROMETHEUS_DEFAULT_JOB_NAME = "default_dubbo_job";
7880

7981
String METRIC_FILTER_START_TIME = "metric_filter_start_time";
82+
83+
String TAG_THREAD_NAME = "thread.pool.name";
8084
}

dubbo-common/src/main/java/org/apache/dubbo/common/deploy/ApplicationDeployer.java

+11
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,15 @@ public interface ApplicationDeployer extends Deployer<ApplicationModel> {
8888
* module state changed callbacks
8989
*/
9090
void notifyModuleChanged(ModuleModel moduleModel, DeployState state);
91+
92+
/**
93+
* Increase the count of service update threads.
94+
* NOTE: should call ${@link ApplicationDeployer#decreaseServiceRefreshCount()} after update finished
95+
*/
96+
void increaseServiceRefreshCount();
97+
98+
/**
99+
* Decrease the count of service update threads
100+
*/
101+
void decreaseServiceRefreshCount();
91102
}

dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/AbstractJSONImpl.java

+19
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,30 @@
1717
package org.apache.dubbo.common.json.impl;
1818

1919
import org.apache.dubbo.common.json.JSON;
20+
import org.apache.dubbo.common.utils.CollectionUtils;
2021

22+
import java.util.HashMap;
23+
import java.util.LinkedList;
2124
import java.util.List;
2225
import java.util.Map;
2326

2427
public abstract class AbstractJSONImpl implements JSON {
28+
@Override
29+
public boolean isSupport() {
30+
try {
31+
Map<String, String> map = new HashMap<>();
32+
map.put("json", "test");
33+
if (!CollectionUtils.mapEquals(map, toJavaObject(toJson(map), Map.class))) {
34+
return false;
35+
}
36+
37+
List<String> list = new LinkedList<>();
38+
list.add("json");
39+
return CollectionUtils.equals(list, toJavaList(toJson(list), String.class));
40+
} catch (Throwable t) {
41+
return false;
42+
}
43+
}
2544

2645
@Override
2746
public List<?> getList(Map<String, ?> obj, String key) {

dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJson2Impl.java

-12
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,13 @@
1616
*/
1717
package org.apache.dubbo.common.json.impl;
1818

19-
import org.apache.dubbo.common.utils.ClassUtils;
20-
2119
import com.alibaba.fastjson2.JSONWriter;
2220

2321
import java.lang.reflect.Type;
2422
import java.util.List;
2523

2624
public class FastJson2Impl extends AbstractJSONImpl {
2725

28-
@Override
29-
public boolean isSupport() {
30-
try {
31-
Class<?> aClass = ClassUtils.forName("com.alibaba.fastjson2.JSON");
32-
return aClass != null;
33-
} catch (Exception t) {
34-
return false;
35-
}
36-
}
37-
3826
@Override
3927
public <T> T toJavaObject(String json, Type type) {
4028
return com.alibaba.fastjson2.JSON.parseObject(json, type);

dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJsonImpl.java

-12
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,13 @@
1616
*/
1717
package org.apache.dubbo.common.json.impl;
1818

19-
import org.apache.dubbo.common.utils.ClassUtils;
20-
2119
import com.alibaba.fastjson.serializer.SerializerFeature;
2220

2321
import java.lang.reflect.Type;
2422
import java.util.List;
2523

2624
public class FastJsonImpl extends AbstractJSONImpl {
2725

28-
@Override
29-
public boolean isSupport() {
30-
try {
31-
Class<?> aClass = ClassUtils.forName("com.alibaba.fastjson.JSON");
32-
return aClass != null;
33-
} catch (Throwable t) {
34-
return false;
35-
}
36-
}
37-
3826
@Override
3927
public <T> T toJavaObject(String json, Type type) {
4028
return com.alibaba.fastjson.JSON.parseObject(json, type);

0 commit comments

Comments
 (0)