You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/05/28 01:41:57 UTC
[GitHub] [pulsar] tisonkun opened a new pull request, #20417: [fix][cli] Fulfill add-opens to function-localrunner also
tisonkun opened a new pull request, #20417:
URL: https://github.com/apache/pulsar/pull/20417
This closes https://github.com/apache/pulsar/issues/20282.
### Motivation
Fulfill add-opens to function-localrunner also.
This issue affects version >= 2.11.
### Verifying this change
- [x] Make sure that the change passes the CI checks and manually tested locally.
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] tisonkun commented on pull request #20417: [fix][cli] Fulfill add-opens to function-localrunner also
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #20417:
URL: https://github.com/apache/pulsar/pull/20417#issuecomment-1566346736
@eolivelli reverted
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a diff in pull request #20417: [fix][cli] Fulfill add-opens to function-localrunner also
Posted by "eolivelli (via GitHub)" <gi...@apache.org>.
eolivelli commented on code in PR #20417:
URL: https://github.com/apache/pulsar/pull/20417#discussion_r1208593503
##########
pulsar-common/src/test/java/org/apache/pulsar/common/util/netty/DnsResolverTest.java:
##########
@@ -18,24 +18,29 @@
*/
package org.apache.pulsar.common.util.netty;
+import static org.assertj.core.api.Assertions.assertThat;
import io.netty.channel.EventLoop;
+import io.netty.resolver.dns.DnsNameResolver;
import io.netty.resolver.dns.DnsNameResolverBuilder;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import org.mockito.MockedConstruction;
import org.mockito.Mockito;
-import org.testng.Assert;
import org.testng.annotations.Test;
public class DnsResolverTest {
@Test
- public void testMaxTtl() {
- EventLoop eventLoop = Mockito.mock(EventLoop.class);
- DnsNameResolverBuilder dnsNameResolverBuilder = new DnsNameResolverBuilder(eventLoop);
+ public void testMaxTtl() throws Exception {
Review Comment:
please remove this change that seems unrelated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lifepuzzlefun commented on pull request #20417: [fix][cli] Fulfill add-opens to function-localrunner also
Posted by "lifepuzzlefun (via GitHub)" <gi...@apache.org>.
lifepuzzlefun commented on PR #20417:
URL: https://github.com/apache/pulsar/pull/20417#issuecomment-1565934125
@tisonkun thanks for this fix. and i saw more add-open options in pulsar start script. do we need them also ? see https://github.com/apache/pulsar/blob/aa3bfcda6935dc2d9c69dce51f96ba80baeae0b7/bin/pulsar#L297-L311
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codecov-commenter commented on pull request #20417: [fix][cli] Fulfill add-opens to function-localrunner also
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #20417:
URL: https://github.com/apache/pulsar/pull/20417#issuecomment-1565868390
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/20417?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#20417](https://app.codecov.io/gh/apache/pulsar/pull/20417?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (6c4f2d8) into [master](https://app.codecov.io/gh/apache/pulsar/commit/a953027aad38c9f54e952133949280ec2f4c04e8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (a953027) will **decrease** coverage by `0.02%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/20417/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/20417?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #20417 +/- ##
============================================
- Coverage 72.95% 72.93% -0.02%
+ Complexity 31893 31891 -2
============================================
Files 1864 1864
Lines 138416 138417 +1
Branches 15188 15188
============================================
- Hits 100976 100952 -24
- Misses 29440 29458 +18
- Partials 8000 8007 +7
```
| Flag | Coverage Δ | |
|---|---|---|
| inttests | `24.09% <ø> (-0.12%)` | :arrow_down: |
| systests | `24.91% <ø> (-0.08%)` | :arrow_down: |
| unittests | `72.22% <ø> (-0.01%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://app.codecov.io/gh/apache/pulsar/pull/20417?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...ache/pulsar/common/util/netty/DnsResolverUtil.java](https://app.codecov.io/gh/apache/pulsar/pull/20417?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NvbW1vbi91dGlsL25ldHR5L0Ruc1Jlc29sdmVyVXRpbC5qYXZh) | `72.22% <ø> (-4.25%)` | :arrow_down: |
... and [65 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/20417/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lifepuzzlefun commented on pull request #20417: [fix][cli] Fulfill add-opens to function-localrunner also
Posted by "lifepuzzlefun (via GitHub)" <gi...@apache.org>.
lifepuzzlefun commented on PR #20417:
URL: https://github.com/apache/pulsar/pull/20417#issuecomment-1565936669
> @lifepuzzlefun I tend to add them on demand instead of pull in too much options. This is also how the upstream JDK's trend to restrict access.
>
> That said, if we open unnecessary modules, it's more likely we introduce more dependency without explicit review.
yes, i agree with you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] tisonkun commented on pull request #20417: [fix][cli] Fulfill add-opens to function-localrunner also
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #20417:
URL: https://github.com/apache/pulsar/pull/20417#issuecomment-1565935948
@lifepuzzlefun I tend to add them on demand instead of pull in too much options. This is also how the upstream JDK's trend to restrict access.
That said, if we open unnecessary modules, it's more likely we introduce more dependency without explicit review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] tisonkun commented on a diff in pull request #20417: [fix][cli] Fulfill add-opens to function-localrunner also
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #20417:
URL: https://github.com/apache/pulsar/pull/20417#discussion_r1208242942
##########
bin/function-localrunner:
##########
@@ -40,13 +40,15 @@ PULSAR_MEM=${PULSAR_MEM:-"-Xmx128m -XX:MaxDirectMemorySize=128m"}
PULSAR_GC=${PULSAR_GC:-"-XX:+UseZGC -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch"}
# Garbage collection log.
-IS_JAVA_8=`$JAVA -version 2>&1 |grep version|grep '"1\.8'`
-# java version has space, use [[ -n $PARAM ]] to judge if variable exists
-if [[ -n "$IS_JAVA_8" ]]; then
- PULSAR_GC_LOG=${PULSAR_GC_LOG:-"-Xloggc:logs/pulsar_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=20M"}
-else
-# After jdk 9, gc log param should config like this. Ignoring version less than jdk 8
+IS_JAVA_8=$( $JAVA -version 2>&1 | grep version | grep '"1\.8' )
+if [[ -z "$IS_JAVA_8" ]]; then
+ # >= JDK 9
PULSAR_GC_LOG=${PULSAR_GC_LOG:-"-Xlog:gc:logs/pulsar_gc_%p.log:time,uptime:filecount=10,filesize=20M"}
+ # '--add-opens' option is not supported in JDK 1.8
+ OPTS="$OPTS --add-opens java.base/sun.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED"
Review Comment:
This is the effective changes. Others are refactors during the debugging stage.
##########
bin/function-localrunner:
##########
@@ -40,13 +40,15 @@ PULSAR_MEM=${PULSAR_MEM:-"-Xmx128m -XX:MaxDirectMemorySize=128m"}
PULSAR_GC=${PULSAR_GC:-"-XX:+UseZGC -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch"}
# Garbage collection log.
-IS_JAVA_8=`$JAVA -version 2>&1 |grep version|grep '"1\.8'`
-# java version has space, use [[ -n $PARAM ]] to judge if variable exists
-if [[ -n "$IS_JAVA_8" ]]; then
- PULSAR_GC_LOG=${PULSAR_GC_LOG:-"-Xloggc:logs/pulsar_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=20M"}
-else
-# After jdk 9, gc log param should config like this. Ignoring version less than jdk 8
+IS_JAVA_8=$( $JAVA -version 2>&1 | grep version | grep '"1\.8' )
+if [[ -z "$IS_JAVA_8" ]]; then
+ # >= JDK 9
PULSAR_GC_LOG=${PULSAR_GC_LOG:-"-Xlog:gc:logs/pulsar_gc_%p.log:time,uptime:filecount=10,filesize=20M"}
+ # '--add-opens' option is not supported in JDK 1.8
+ OPTS="$OPTS --add-opens java.base/sun.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED"
Review Comment:
This is the effective change. Others are refactors during the debugging stage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] tisonkun merged pull request #20417: [fix][cli] Fulfill add-opens to function-localrunner also
Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #20417:
URL: https://github.com/apache/pulsar/pull/20417
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org