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

Remove netty-all dependency #10818

Merged
merged 13 commits into from Nov 7, 2022
Merged

Remove netty-all dependency #10818

merged 13 commits into from Nov 7, 2022

Conversation

EarthChen
Copy link
Member

What is the purpose of the change

Brief changelog

Verifying this change

Checklist

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

Comment on lines 221 to 265
<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-codec</artifactId>-->
<!-- <version>${netty4_version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-handler</artifactId>-->
<!-- <version>${netty4_version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-codec-http2</artifactId>-->
<!-- <version>${netty4_version}</version>-->
<!-- </dependency>-->

<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-transport-native-epoll</artifactId>-->
<!-- <version>${netty4_version}</version>-->
<!-- <classifier>linux-x86_64</classifier>-->
<!-- <scope>runtime</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-transport-native-epoll</artifactId>-->
<!-- <version>${netty4_version}</version>-->
<!-- <classifier>linux-aarch_64</classifier>-->
<!-- <scope>runtime</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-transport-native-kqueue</artifactId>-->
<!-- <version>${netty4_version}</version>-->
<!-- <classifier>osx-x86_64</classifier>-->
<!-- <scope>runtime</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>netty-transport-native-kqueue</artifactId>-->
<!-- <version>${netty4_version}</version>-->
<!-- <classifier>osx-aarch_64</classifier>-->
<!-- <scope>runtime</scope>-->
<!-- </dependency>-->

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused code

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>4.1.72.Final</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version should be managed in dubbo-dependenies-bom

Comment on lines 1 to 299

@Override
public void onError(Throwable throwable) {

}

@Override
public void onCompleted() {
observer.onCompleted();
}
});
return result;
});
MethodDescriptor method = Mockito.mock(MethodDescriptor.class);
when(method.getParameterClasses())
.thenReturn(new Class[]{String.class});
when(method.getMethodName())
.thenReturn("sayHello");
String request = "request";
CountDownLatch latch = new CountDownLatch(11);
StreamObserver<Object> responseObserver = new StreamObserver<Object>() {
@Override
public void onNext(Object data) {
latch.countDown();
}

@Override
public void onError(Throwable throwable) {
}

@Override
public void onCompleted() {
latch.countDown();
}
};
StreamObserver<Object> observer = StubInvocationUtil.biOrClientStreamCall(invoker, method,
responseObserver);
for (int i = 0; i < 10; i++) {
observer.onNext(request);
}
observer.onCompleted();
Assertions.assertTrue(latch.await(1, TimeUnit.SECONDS));
}

@Test
void serverStreamCall() throws InterruptedException {
Invoker<DemoService> invoker = Mockito.mock(Invoker.class);
URL url = Mockito.mock(URL.class);
ConsumerModel consumerModel = Mockito.mock(ConsumerModel.class);
ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class);
when(consumerModel.getServiceModel()).thenReturn(serviceDescriptor);
when(url.getServiceModel())
.thenReturn(consumerModel);
when(url.getServiceInterface())
.thenReturn(DemoService.class.getName());
when(url.getProtocolServiceKey())
.thenReturn(DemoService.class.getName());
when(invoker.getUrl())
.thenReturn(url);
when(invoker.getInterface())
.thenReturn(DemoService.class);
Result result = Mockito.mock(Result.class);
String response = "response";
when(invoker.invoke(any(Invocation.class)))
.then(invocationOnMock -> {
Invocation invocation = (Invocation) invocationOnMock.getArguments()[0];
StreamObserver<Object> observer = (StreamObserver<Object>) invocation.getArguments()[1];
for (int i = 0; i < 10; i++) {
observer.onNext(response);
}
observer.onCompleted();
return result;
});
MethodDescriptor method = Mockito.mock(MethodDescriptor.class);
when(method.getParameterClasses())
.thenReturn(new Class[]{String.class});
when(method.getMethodName())
.thenReturn("sayHello");
String request = "request";
CountDownLatch latch = new CountDownLatch(11);
StreamObserver<Object> responseObserver = new StreamObserver<Object>() {
@Override
public void onNext(Object data) {
latch.countDown();
}

@Override
public void onError(Throwable throwable) {
}

@Override
public void onCompleted() {
latch.countDown();
}
};
StubInvocationUtil.serverStreamCall(invoker, method, request, responseObserver);
Assertions.assertTrue(latch.await(1, TimeUnit.SECONDS));
}

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this class

Comment on lines 1 to 22
///*
// * Licensed to the Apache Software Foundation (ASF) under one or more
// * contributor license agreements. See the NOTICE file distributed with
// * this work for additional information regarding copyright ownership.
// * The ASF licenses this file to You under the Apache License, Version 2.0
// * (the "License"); you may not use this file except in compliance with
// * the License. You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */
//
//package org.apache.dubbo.rpc;
//
//import org.apache.dubbo.common.URL;
//import org.apache.dubbo.common.stream.StreamObserver;
//import org.apache.dubbo.rpc.model.ConsumerModel;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this class

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this filed change to os auto detected

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2022

Codecov Report

Merging #10818 (22ea669) into 3.1 (d04f03a) will decrease coverage by 3.34%.
The diff coverage is 85.71%.

@@             Coverage Diff              @@
##                3.1   #10818      +/-   ##
============================================
- Coverage     67.87%   64.53%   -3.35%     
+ Complexity      510      469      -41     
============================================
  Files          1348     1336      -12     
  Lines         66361    57004    -9357     
  Branches      11234     8405    -2829     
============================================
- Hits          45045    36786    -8259     
+ Misses        16981    16262     -719     
+ Partials       4335     3956     -379     
Impacted Files Coverage Δ
.../java/org/apache/dubbo/rpc/StatusRpcException.java 100.00% <ø> (ø)
.../org/apache/dubbo/rpc/stub/StubInvocationUtil.java 86.36% <ø> (ø)
...c/main/java/org/apache/dubbo/rpc/TriRpcStatus.java 85.36% <85.71%> (ø)
...luster/router/script/ScriptStateRouterFactory.java 0.00% <0.00%> (-100.00%) ⬇️
...zookeeper/curator/CuratorZookeeperTransporter.java 0.00% <0.00%> (-100.00%) ⬇️
...pc/cluster/router/file/FileStateRouterFactory.java 0.00% <0.00%> (-80.96%) ⬇️
...o/rpc/cluster/router/script/ScriptStateRouter.java 0.00% <0.00%> (-73.34%) ⬇️
...ting/zookeeper/curator/CuratorZookeeperClient.java 15.38% <0.00%> (-62.83%) ⬇️
...mmon/serialize/fastjson2/FastJson2ObjectInput.java 0.00% <0.00%> (-62.50%) ⬇️
...mon/serialize/fastjson2/FastJson2ObjectOutput.java 0.00% <0.00%> (-56.25%) ⬇️
... and 347 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@EarthChen
Copy link
Member Author

EarthChen commented Nov 5, 2022

dubbo-all is not modified for user compatibility. then consider to provide different dubbo pom for different scenarios.

Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlbumenJ AlbumenJ merged commit 0876d8a into apache:3.1 Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants