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

Feature/repairkafka3.7 #707

Merged
merged 23 commits into from
Jul 25, 2024
Merged

Feature/repairkafka3.7 #707

merged 23 commits into from
Jul 25, 2024

Conversation

darkness-2nd
Copy link
Contributor

@darkness-2nd darkness-2nd commented Jul 21, 2024

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

@wu-sheng
Copy link
Member

Please explain what is changing here, and if this is a plugin update, you need to update test scenarios too.

@wu-sheng
Copy link
Member

If the new use cases are same here, you should add more versions to support your new implementations for newer versions, and keep compatibility with previous.

Comment on lines 67 to 72
return new ConstructorInterceptPoint[]{
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArgumentWithType(0, CONSTRUCTOR_INTERCEPT_TYPE);
}
Copy link
Member

Choose a reason for hiding this comment

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

You should not reformat, thr code style file is in the source codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You should not reformat, thr code style file is in the source codes.

I reset the java file which I reformat

@wu-sheng wu-sheng added enhancement New feature or request plugin labels Jul 21, 2024
@darkness-2nd
Copy link
Contributor Author

ase explain what is changing here, and if th

If the new use cases are same here, you should add more versions to support your new implementations for newer versions, and keep compatibility with previous.

Ok, I'll commit later

@wu-sheng
Copy link
Member

Please pick one for 3.4, 3.5, 3.6 as well.

@darkness-2nd
Copy link
Contributor Author

Please pick one for 3.4, 3.5, 3.6 as well.

3.4, 3.5, 3.6 are same to 3.2.3

@wu-sheng
Copy link
Member

Logically same. But we should test.

@darkness-2nd
Copy link
Contributor Author

Logically same. But we should test.

OK, Should I create modules kafka-3.6.x-scenario and kafka-3.7.x-scenario like kafka-2.3.x-scenario in dir /test?

@wu-sheng
Copy link
Member

Logically same. But we should test.

OK, Should I create modules kafka-3.6.x-scenario and kafka-3.7.x-scenario like kafka-2.3.x-scenario in dir /test?

Those exist because the test codes are different. If you just need to change dependency versions, you don't need to do that.

@wu-sheng
Copy link
Member

And please fix CIs.

@wu-sheng
Copy link
Member

You should verify all locally rather than costing too much on CI.

@darkness-2nd
Copy link
Contributor Author

You should verify all locally rather than costing too much on CI.
Sry, it's my first time to create PR in github, I'm doing test CI in my private branch now

@@ -19,4 +19,3 @@ The plugin of JDK HttpURLConnection depended on `sun.net.*`. When using Java 9+,

For more information
1. [JEP 403: Strongly Encapsulate JDK Internals](https://openjdk.org/jeps/403)
2. [A peek into Java 17: Encapsulating the Java runtime internals](https://blogs.oracle.com/javamagazine/post/a-peek-into-java-17-continuing-the-drive-to-encapsulate-the-java-runtime-internals)
Copy link
Member

Choose a reason for hiding this comment

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

I think you made a mistake to remove this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you made a mistake to remove this line?

No, the CI thiks this line is a deadlink, though it can be access in browser

Copy link
Member

Choose a reason for hiding this comment

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

The blog is there. What is the deadlink check saying?

Copy link
Member

Choose a reason for hiding this comment

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

You should not remove the docs, just because a CI took says otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You should not remove the docs, just because a CI took says otherwise.

OK, I will rollback it, thank you!

@wu-sheng
Copy link
Member

--- /home/runner/work/skywalking-java/skywalking-java/tools/plugin/md-javaagent-plugin-list.txt 2024-07-25 03:04:25.186078041 +0000
+++ /home/runner/work/skywalking-java/skywalking-java/tools/plugin/genernate-javaagent-plugin-list.txt 2024-07-25 03:04:25.178078015 +0000

I think you did not update docs accordingly, Plugin-list.md and Supported-list.md

Comment on lines 66 to 87
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArgumentWithType(0, CONSTRUCTOR_INTERCEPT_TYPE);
}

@Override
public String getConstructorInterceptor() {
return CONSUMER_CONFIG_CONSTRUCTOR_INTERCEPTOR_CLASS;
}
},
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArgumentWithType(0, CONSTRUCTOR_INTERCEPT_MAP_TYPE);
}

@Override
public String getConstructorInterceptor() {
return MAP_CONSTRUCTOR_INTERCEPTOR_CLASS;
}
},
@Override
public String getConstructorInterceptor() {
return CONSUMER_CONFIG_CONSTRUCTOR_INTERCEPTOR_CLASS;
}
},
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArgumentWithType(0, CONSTRUCTOR_INTERCEPT_MAP_TYPE);
}

@Override
public String getConstructorInterceptor() {
return MAP_CONSTRUCTOR_INTERCEPTOR_CLASS;
}
},
Copy link
Member

Choose a reason for hiding this comment

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

Please revert re-format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please revert re-format.

I have already recerted it, this class dosen't change, I have already rollback it to the original version

Copy link
Contributor

Choose a reason for hiding this comment

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

I have already recerted it, this class dosen't change, I have already rollback it to the original version

No, you didn't. Change is still there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have already recerted it, this class dosen't change, I have already rollback it to the original version

No, you didn't. Change is still there.

Those changes are compare to the changes which are not correct I commit before...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have already recerted it, this class dosen't change, I have already rollback it to the original version

No, you didn't. Change is still there.

I dont't know why.... I check out the original branch and copy the codes into the class file, but the IDE says that there is no difference.....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have already recerted it, this class dosen't change, I have already rollback it to the original version

No, you didn't. Change is still there.

Resolved

Comment on lines 40 to 41
Map<TopicPartition, List<ConsumerRecord<?, ?>>> rsp = new HashMap<>();
if (retObj instanceof ConsumerRecords) {
Copy link
Member

Choose a reason for hiding this comment

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

Why instanceof? Is there another case to have another parameter? The parent class has Map<TopicPartition, List<ConsumerRecord<?, ?>>> type as the parameter, but it should not affect this new Kafka37ConsumerInterceptor, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class should be removed, I missed it, I'll delete it at next commit

@darkness-2nd
Copy link
Contributor Author

--- /home/runner/work/skywalking-java/skywalking-java/tools/plugin/md-javaagent-plugin-list.txt 2024-07-25 03:04:25.186078041 +0000
+++ /home/runner/work/skywalking-java/skywalking-java/tools/plugin/genernate-javaagent-plugin-list.txt 2024-07-25 03:04:25.178078015 +0000

I think you did not update docs accordingly, Plugin-list.md and Supported-list.md

--- /home/runner/work/skywalking-java/skywalking-java/tools/plugin/md-javaagent-plugin-list.txt 2024-07-25 03:04:25.186078041 +0000
+++ /home/runner/work/skywalking-java/skywalking-java/tools/plugin/genernate-javaagent-plugin-list.txt 2024-07-25 03:04:25.178078015 +0000

I think you did not update docs accordingly, Plugin-list.md and Supported-list.md

And please fix CIs.

And please fix CIs.

And please fix CIs.

All the CIs were successfully executed but the DeadLink check

@wu-sheng
Copy link
Member

@kezhenxu94 As 403 respond code, should we add this into ignore list?

Comment on lines 66 to 87
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArgumentWithType(0, CONSTRUCTOR_INTERCEPT_TYPE);
}

@Override
public String getConstructorInterceptor() {
return CONSUMER_CONFIG_CONSTRUCTOR_INTERCEPTOR_CLASS;
}
},
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArgumentWithType(0, CONSTRUCTOR_INTERCEPT_MAP_TYPE);
}

@Override
public String getConstructorInterceptor() {
return MAP_CONSTRUCTOR_INTERCEPTOR_CLASS;
}
},
@Override
public String getConstructorInterceptor() {
return CONSUMER_CONFIG_CONSTRUCTOR_INTERCEPTOR_CLASS;
}
},
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArgumentWithType(0, CONSTRUCTOR_INTERCEPT_MAP_TYPE);
}

@Override
public String getConstructorInterceptor() {
return MAP_CONSTRUCTOR_INTERCEPTOR_CLASS;
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I have already recerted it, this class dosen't change, I have already rollback it to the original version

No, you didn't. Change is still there.

import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

For the comment, I think we can focus on the difference instead of repeating what is already written in the parent class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the comment, I think we can focus on the difference instead of repeating what is already written in the parent class.

Yes, the difference is the method named pollForFetchs was removed from KafkaConsumer to another two classes, so the original interceptor can not intercept it. Because of the enhance class is changed, so I create two new classes to repair the uncompatible problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the difference is the method named pollForFetchs was removed from KafkaConsumer to another two classes, so the original interceptor can not intercept it. Because of the enhance class is changed, so I create two new classes to repair the uncompatible problem.

I meant you can modify the comment for this class......

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I forget to change the comment

wu-sheng
wu-sheng previously approved these changes Jul 25, 2024
@wu-sheng
Copy link
Member

One more. changes.md should be updated as well.

@darkness-2nd
Copy link
Contributor Author

One more. changes.md should be updated as well.
Changed

@wu-sheng wu-sheng added this to the 9.3.0 milestone Jul 25, 2024
@wu-sheng wu-sheng merged commit 744eb1e into apache:main Jul 25, 2024
190 of 191 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants