Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 4.0.x to 4.1.0 #1228

Closed
wants to merge 114 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
06416d2
Update 4.0.0 (#1056)
HzjNeverStop Jan 18, 2023
f351bf3
revert (#1057)
HzjNeverStop Feb 1, 2023
2dcb5f6
add sofa-boot module unit tests (#1058)
HzjNeverStop Feb 1, 2023
3586325
add autoconfiguration module unit tests (#1059)
HzjNeverStop Feb 1, 2023
85bec94
rpc auto configuration refactor (#1060)
taobaorun Feb 1, 2023
6db39ad
add runtime module unit tests (#1062)
HzjNeverStop Feb 2, 2023
c831377
rpc auto configuration test case (#1063)
taobaorun Feb 2, 2023
4a6547f
add isle unite tests (#1064)
HzjNeverStop Feb 3, 2023
4896a22
fix unit tests (#1066)
HzjNeverStop Feb 3, 2023
73362ec
remore feign configuration (#1068)
HzjNeverStop Feb 3, 2023
f5507c2
Fix rpc swagger export (#1069)
HzjNeverStop Feb 6, 2023
59749b8
rpc smoke tests (#1070)
taobaorun Feb 7, 2023
fb9a670
Fix rpc properties (#1072)
HzjNeverStop Feb 8, 2023
d9926c6
add default endpoints (#1073)
HzjNeverStop Feb 9, 2023
1275443
Update test maven config (#1074)
HzjNeverStop Feb 9, 2023
4e6780b
Update codes (#1075)
HzjNeverStop Feb 9, 2023
3164140
rpc smoke tests modify (#1076)
taobaorun Feb 13, 2023
a06803f
add cpu core constants (#1077)
HzjNeverStop Feb 14, 2023
8729c55
update dependencies (#1079)
HzjNeverStop Feb 16, 2023
ecdc1a1
Fix junit4 tests (#1080)
HzjNeverStop Feb 16, 2023
fdeb2ab
Fix junit4 tests (#1081)
HzjNeverStop Feb 16, 2023
5f40b2a
Fix all tests (#1082)
HzjNeverStop Feb 16, 2023
47452dd
4.0.0 (#1083)
taobaorun Feb 17, 2023
0595651
update sofaboot switch (#1084)
HzjNeverStop Feb 17, 2023
ea5b0d9
fix rpc unit tests (#1085)
HzjNeverStop Feb 17, 2023
83dc684
fix gradle tool (#1086)
HzjNeverStop Feb 17, 2023
1ca32a7
Update log (#1088)
HzjNeverStop Feb 21, 2023
acbadf0
add snapshot yaml (#1089)
HzjNeverStop Feb 21, 2023
b70f1f6
fix_rpc_configuration_test
Feb 21, 2023
ce5610b
update github workflow
Feb 21, 2023
2000b2e
fix smoke runtime unit tests
Feb 21, 2023
b49c7a8
fix rpc unit test
Feb 21, 2023
3084dfd
add isle integration tests (#1091)
HzjNeverStop Feb 22, 2023
2634056
Add runtime tets (#1092)
HzjNeverStop Feb 22, 2023
c5b8315
bean on switch smoke test (#1093)
taobaorun Feb 22, 2023
58fc058
add test module (#1094)
HzjNeverStop Feb 23, 2023
201efc4
Add test module (#1096)
HzjNeverStop Feb 23, 2023
53d1ba2
fix_readiness_thredpool_configuration (#1098)
HzjNeverStop Feb 27, 2023
cfa6559
update local env (#1099)
HzjNeverStop Feb 27, 2023
1c997fb
support duplicate isle module (#1100)
HzjNeverStop Feb 27, 2023
6b62fdf
Fix error properties (#1101)
HzjNeverStop Feb 28, 2023
c439cf4
Update maven dependncies (#1102)
HzjNeverStop Mar 2, 2023
26e93b1
Add sofaboot swtich (#1104)
HzjNeverStop Mar 2, 2023
27bac34
remove health indicator (#1105)
HzjNeverStop Mar 3, 2023
d9740f4
use BufferedApplicationStartup static startup (#1107)
HzjNeverStop Mar 6, 2023
2589151
support healthcheck startup (#1108)
HzjNeverStop Mar 7, 2023
62d0a3f
Update tracer 4.0.0 (#1109)
HzjNeverStop Mar 8, 2023
d213487
add FeignClientAutoConfigurationTests
Mar 8, 2023
f19852f
reactor switch on scenes (#1106)
taobaorun Mar 9, 2023
4c2e077
update readme.md (#1110)
HzjNeverStop Mar 9, 2023
4ebb9da
Fix components end point (#1078) (#1111)
HzjNeverStop Mar 10, 2023
ad3f63b
add scenes log (#1112)
HzjNeverStop Mar 10, 2023
c91a48e
1. update springboot 3.0.4 (#1113)
HzjNeverStop Mar 14, 2023
1793bb9
support custom readiness actuator http response code (#1114)
HzjNeverStop Mar 14, 2023
602188f
Support startup parent self time (#1115)
HzjNeverStop Mar 15, 2023
b1b3875
update swagger and swagger2 version (#1118)
HzjNeverStop Mar 15, 2023
ce78a14
Add rpc actuator configuration (#1119)
HzjNeverStop Mar 16, 2023
1ac6c38
Fix rpc grpc tests (#1122)
HzjNeverStop Mar 17, 2023
57016ec
update maven staging plugin to 1.6.13
Mar 21, 2023
f59254d
upgrade javassit version to 3.29.2-GA ,rpc smoke tests use javassist …
taobaorun Mar 22, 2023
ffdd7d4
4.0.0 (#1126)
HzjNeverStop Mar 23, 2023
a9c1074
update springboot 3.0.5 (#1131)
HzjNeverStop Mar 28, 2023
32541ae
Update dubbo 3.1.8 and curator 4.3.0 (#1128)
HzjNeverStop Mar 29, 2023
f0af3d7
Update guice 5.1.0 (#1139)
HzjNeverStop Mar 31, 2023
33b0d32
add unit tests for util (#1140)
HzjNeverStop Apr 3, 2023
dd55164
remove guice-multibindings (#1142)
HzjNeverStop Apr 3, 2023
29b0120
Add sofa boot ut (#1141)
HzjNeverStop Apr 3, 2023
5b9d707
add uts (#1143)
HzjNeverStop Apr 3, 2023
607b847
Add sofa boot autoconfiguration uts (#1144)
HzjNeverStop Apr 4, 2023
724ba81
Update jacoco plugin 0.8.9 (#1145)
HzjNeverStop Apr 4, 2023
cb61ca0
Update codecov-action@v3 (#1146)
HzjNeverStop Apr 4, 2023
a8693b4
Add jacoco module (#1148)
HzjNeverStop Apr 4, 2023
a7dce6e
Add codecov configs (#1151)
HzjNeverStop Apr 6, 2023
da49794
Add ark tests (#1152)
HzjNeverStop Apr 6, 2023
9cca155
Fix rpc tests report (#1153)
HzjNeverStop Apr 6, 2023
2770734
Add isle module uts (#1154)
HzjNeverStop Apr 7, 2023
69d679b
add unit tests for runtime (#1157)
HzjNeverStop Apr 10, 2023
f93c89b
Add runtime unittests (#1158)
HzjNeverStop Apr 11, 2023
b984985
add legacy configurations detect (#1161)
HzjNeverStop Apr 18, 2023
c2b4a21
Cherry pick from 3.18.0 (#1164)
HzjNeverStop Apr 19, 2023
ca80e08
optimize RuntimeContextBeanFactoryPostProcessor (#1165)
HzjNeverStop Apr 20, 2023
d67e150
optimize springcloud bootstrap log properties (#1166)
HzjNeverStop Apr 24, 2023
d5be2ae
add spring.boot.version properties (#1168)
HzjNeverStop Apr 24, 2023
8e3728d
Add ark tests (#1167)
HzjNeverStop Apr 24, 2023
82b403a
add sofarpc endpoint (#1169)
HzjNeverStop Apr 24, 2023
1c98fb6
Add isle enable condition (#1171)
HzjNeverStop Apr 25, 2023
a2c6b10
ComponentsDescriptor implements OperationResponseBody
Apr 25, 2023
50ee113
use spring.factories instead of jdk spi (#1175)
HzjNeverStop May 24, 2023
6b77bb7
Merge v3.19.0 (#1182)
HzjNeverStop Jun 5, 2023
7b18f8e
update springboot 3.0.7 (#1183)
HzjNeverStop Jun 5, 2023
2274a73
update listener order (#1184)
HzjNeverStop Jun 5, 2023
63d4d6a
1. distinct requrie modules (#1185)
HzjNeverStop Jun 9, 2023
9a6e4f4
Revert extenstion package (#1186)
HzjNeverStop Jun 9, 2023
30e8352
Add legacy rpc property (#1189)
HzjNeverStop Jun 16, 2023
0faf7eb
Release dependencies (#1190)
HzjNeverStop Jun 21, 2023
63c87b3
Cherry pick 3.21.1 (#1195)
HzjNeverStop Jun 21, 2023
ae27d9a
Update springboot version (#1196)
HzjNeverStop Jun 21, 2023
5b173e2
Release 4.0.0 (#1198)
HzjNeverStop Jun 25, 2023
c5bbf91
1. update 4.0.1
Jul 31, 2023
08e31e0
update springboot to 3.0.9
Aug 1, 2023
a933193
Merge branch '4.0.x' into v4.0.1
Aug 2, 2023
1a9340f
add ci rule
Aug 2, 2023
eb869a4
add ci rule (#1211)
HzjNeverStop Aug 2, 2023
93d3599
use logback 1.4.7
Aug 2, 2023
350c371
Merge branch '4.0.x' into v4.0.1
Aug 2, 2023
4233165
use logback 1.4.7
Aug 2, 2023
da21338
update SofaRuntimeContainer clear
Aug 7, 2023
2b84eb3
Merge branch '4.0.x' of https://github.com/sofastack/sofa-boot into 4…
Aug 7, 2023
6023714
Merge branch '4.0.x' into v4.0.1
Aug 7, 2023
be65466
add ark dependency
Aug 8, 2023
ae97bb2
remove threadlocal after use
Aug 10, 2023
3363ed6
use DefaultParameterNameDiscoverer instead of StandardReflectionParam…
Aug 14, 2023
d6a6563
use DefaultParameterNameDiscoverer instead of StandardReflectionParam…
Aug 14, 2023
ba979f0
Merge branch 'v4.0.1' into 4.1.0_dev
Aug 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.util.Assert;

import java.util.Collection;
import java.util.Map;
Expand Down Expand Up @@ -50,16 +51,17 @@ public SofaRuntimeContainer(SofaRuntimeManager sofaRuntimeManager) {
}

public SofaRuntimeContainer(SofaRuntimeManager sofaRuntimeManager, ClassLoader classLoader) {
Assert.notNull(classLoader, "classLoader must not be null");
this.contextClassLoader = classLoader;
SOFA_RUNTIME_MANAGER_MAP.put(contextClassLoader, sofaRuntimeManager);
}

public void setJvmServiceCache(boolean jvmServiceCache) {
JVM_SERVICE_CACHE_MAP.put(contextClassLoader, jvmServiceCache);
JVM_SERVICE_CACHE_MAP.putIfAbsent(contextClassLoader, jvmServiceCache);
}

public void setJvmInvokeSerialize(boolean jvmInvokeSerialize) {
JVM_INVOKE_SERIALIZE_MAP.put(contextClassLoader, jvmInvokeSerialize);
JVM_INVOKE_SERIALIZE_MAP.putIfAbsent(contextClassLoader, jvmInvokeSerialize);
}

@Override
Expand All @@ -75,10 +77,18 @@ public static SofaRuntimeManager getSofaRuntimeManager(ClassLoader classLoader)
return SOFA_RUNTIME_MANAGER_MAP.get(classLoader);
}

public static void updateJvmServiceCache(ClassLoader classLoader, Boolean value) {
JVM_SERVICE_CACHE_MAP.put(classLoader, value);
}

public static boolean isJvmServiceCache(ClassLoader classLoader) {
return JVM_SERVICE_CACHE_MAP.getOrDefault(classLoader, false);
}

public static void updateJvmInvokeSerialize(ClassLoader classLoader, Boolean value) {
JVM_INVOKE_SERIALIZE_MAP.put(classLoader, value);
}

public static boolean isJvmInvokeSerialize(ClassLoader classLoader) {
return JVM_INVOKE_SERIALIZE_MAP.getOrDefault(classLoader, true);
}
Expand All @@ -95,7 +105,10 @@ public static void clear() {
}

@Override
public void destroy() throws Exception {
public void destroy() {
APPLICATION_CONTEXT_MAP.remove(contextClassLoader);
SOFA_RUNTIME_MANAGER_MAP.remove(contextClassLoader);
JVM_SERVICE_CACHE_MAP.remove(contextClassLoader);
JVM_INVOKE_SERIALIZE_MAP.remove(contextClassLoader);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected Object doInvoke(MethodInvocation invocation) throws Throwable {
if (DynamicJvmServiceProxyFinder.getInstance().getBizManagerService() != null) {
ReplayContext.clearPlaceHolder();
}
setClientClassloader(null);
clearClientClassloader();
}
}

Expand Down Expand Up @@ -144,6 +144,10 @@ public void setClientClassloader(ClassLoader clientClassloader) {
this.clientClassloader.set(clientClassloader);
}

public void clearClientClassloader() {
this.clientClassloader.remove();
}

private Method getTargetMethod(Method method, Class<?>[] argumentTypes) {
try {
return targetService.getClass().getMethod(method.getName(), argumentTypes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,27 @@ public void updateProperties() {
assertThat(SofaRuntimeContainer.isJvmInvokeSerialize(classLoaderA)).isFalse();
assertThat(SofaRuntimeContainer.isJvmServiceCache(classLoaderA)).isTrue();
}

@Test
public void updatePropertiesAfterStaticSet() {
Thread.currentThread().setContextClassLoader(classLoaderA);
SofaRuntimeContainer sofaRuntimeContainer = new SofaRuntimeContainer(sofaRuntimeManagerA);
GenericApplicationContext genericApplicationContext = new GenericApplicationContext();
sofaRuntimeContainer.setApplicationContext(genericApplicationContext);

assertThat(SofaRuntimeContainer.isJvmInvokeSerialize(classLoaderA)).isTrue();
assertThat(SofaRuntimeContainer.isJvmServiceCache(classLoaderA)).isFalse();

SofaRuntimeContainer.updateJvmInvokeSerialize(classLoaderA, false);
SofaRuntimeContainer.updateJvmServiceCache(classLoaderA, true);

assertThat(SofaRuntimeContainer.isJvmInvokeSerialize(classLoaderA)).isFalse();
assertThat(SofaRuntimeContainer.isJvmServiceCache(classLoaderA)).isTrue();

sofaRuntimeContainer.setJvmInvokeSerialize(true);
sofaRuntimeContainer.setJvmServiceCache(false);

assertThat(SofaRuntimeContainer.isJvmInvokeSerialize(classLoaderA)).isFalse();
assertThat(SofaRuntimeContainer.isJvmServiceCache(classLoaderA)).isTrue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ScannedGenericBeanDefinition;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.Ordered;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.core.type.MethodMetadata;
import org.springframework.core.type.StandardMethodMetadata;
Expand Down Expand Up @@ -107,8 +109,12 @@ public class ServiceBeanFactoryPostProcessor implements BeanFactoryPostProcessor
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
throws BeansException {
if (beanFactory instanceof AbstractAutowireCapableBeanFactory) {
ParameterNameDiscoverer parameterNameDiscoverer = ((AbstractAutowireCapableBeanFactory) beanFactory).getParameterNameDiscoverer();
if (parameterNameDiscoverer == null) {
parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
}
((AbstractAutowireCapableBeanFactory) beanFactory)
.setParameterNameDiscoverer(new SofaParameterNameDiscoverer(referenceAnnotationWrapper));
.setParameterNameDiscoverer(new SofaParameterNameDiscoverer(parameterNameDiscoverer, referenceAnnotationWrapper));
}

Arrays.stream(beanFactory.getBeanDefinitionNames())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.alipay.sofa.boot.annotation.AnnotationWrapper;
import com.alipay.sofa.runtime.api.annotation.SofaReference;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.core.StandardReflectionParameterNameDiscoverer;

import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
Expand All @@ -33,26 +32,27 @@
*/
public class SofaParameterNameDiscoverer implements ParameterNameDiscoverer {

private final StandardReflectionParameterNameDiscoverer standardReflectionParameterNameDiscoverer = new StandardReflectionParameterNameDiscoverer();
private final ParameterNameDiscoverer parameterNameDiscoverer;

private final AnnotationWrapper<SofaReference> referenceAnnotationWrapper;
private final AnnotationWrapper<SofaReference> referenceAnnotationWrapper;

public SofaParameterNameDiscoverer(AnnotationWrapper<SofaReference> referenceAnnotationWrapper) {
public SofaParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer,
AnnotationWrapper<SofaReference> referenceAnnotationWrapper) {
this.parameterNameDiscoverer = parameterNameDiscoverer;
this.referenceAnnotationWrapper = referenceAnnotationWrapper;
}

@Override
public String[] getParameterNames(Method method) {
String[] parameterNames = standardReflectionParameterNameDiscoverer
.getParameterNames(method);
String[] parameterNames = parameterNameDiscoverer.getParameterNames(method);
Class<?>[] parameterTypes = method.getParameterTypes();
Annotation[][] annotations = method.getParameterAnnotations();
return transformParameterNames(parameterNames, parameterTypes, annotations);
}

@Override
public String[] getParameterNames(Constructor<?> ctor) {
String[] parameterNames = standardReflectionParameterNameDiscoverer.getParameterNames(ctor);
String[] parameterNames = parameterNameDiscoverer.getParameterNames(ctor);
Class<?>[] parameterTypes = ctor.getParameterTypes();
Annotation[][] annotations = ctor.getParameterAnnotations();
return transformParameterNames(parameterNames, parameterTypes, annotations);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.alipay.sofa.runtime.api.annotation.SofaReference;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.util.ReflectionUtils;

Expand Down Expand Up @@ -48,7 +49,8 @@ public void setUp() {
mockEnvironment = new MockEnvironment();
annotationWrapper = AnnotationWrapper.create(SofaReference.class)
.withEnvironment(mockEnvironment).withBinder(DefaultPlaceHolderBinder.INSTANCE);
parameterNameDiscoverer = new SofaParameterNameDiscoverer(annotationWrapper);
parameterNameDiscoverer = new SofaParameterNameDiscoverer(
new DefaultParameterNameDiscoverer(), annotationWrapper);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver;
import org.springframework.beans.propertyeditors.ClassArrayEditor;
import org.springframework.beans.propertyeditors.ClassEditor;
import org.springframework.core.StandardReflectionParameterNameDiscoverer;
import org.springframework.core.DefaultParameterNameDiscoverer;

import java.util.function.Function;
import java.util.function.Supplier;
Expand All @@ -40,7 +40,7 @@ public static SofaDefaultListableBeanFactory createBeanFactory(ClassLoader beanC
if (!(beanFactory.getAutowireCandidateResolver() instanceof QualifierAnnotationAutowireCandidateResolver)) {
beanFactory.setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver());
}
beanFactory.setParameterNameDiscoverer(new StandardReflectionParameterNameDiscoverer());
beanFactory.setParameterNameDiscoverer(new DefaultParameterNameDiscoverer());
beanFactory.setBeanClassLoader(beanClassLoader);
beanFactory.addPropertyEditorRegistrar(registry -> {
registry.registerCustomEditor(Class.class, new ClassEditor(beanClassLoader));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver;
import org.springframework.core.StandardReflectionParameterNameDiscoverer;
import org.springframework.core.DefaultParameterNameDiscoverer;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -39,7 +39,7 @@ public void createBeanFactory() {
assertThat(beanFactory).isNotNull();
assertThat(beanFactory.getAutowireCandidateResolver()).isInstanceOf(QualifierAnnotationAutowireCandidateResolver.class);
assertThat(beanFactory.getBeanClassLoader()).isEqualTo(classLoader);
assertThat(beanFactory.getParameterNameDiscoverer()).isInstanceOf(StandardReflectionParameterNameDiscoverer.class);
assertThat(beanFactory.getParameterNameDiscoverer()).isInstanceOf(DefaultParameterNameDiscoverer.class);
assertThat(beanFactory.getPropertyEditorRegistrars().size() >= 1).isTrue();
}

Expand Down
12 changes: 12 additions & 0 deletions sofa-boot-project/sofaboot-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,18 @@
<version>${sofa.ark.version}</version>
</dependency>

<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-all</artifactId>
<version>${sofa.ark.version}</version>
</dependency>

<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-exception</artifactId>
<version>${sofa.ark.version}</version>
</dependency>

<dependency>
<groupId>com.alipay.sofa.lookout</groupId>
<artifactId>lookout-api</artifactId>
Expand Down