You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/12/09 19:16:37 UTC
[GitHub] [skywalking-java] DominikHubacek opened a new pull request #81: Fix
DominikHubacek opened a new pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81
<!--
⚠️ Please make sure to read this template first, pull requests that don't accord with this template
maybe closed without notice.
Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
-->
<!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
### Fix <bug description or the bug issue number or bug issue link>
- [ ] Add a unit test to verify that the fix works.
- [ ] Explain briefly why the bug exists and how to fix it.
==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
<!-- ==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👇 ====
### Add an agent plugin to support <framework name>
- [ ] Add a test case for the new plugin, refer to [the doc](https://github.com/apache/skywalking-java/blob/main/docs/en/setup/service-agent/java-agent/Plugin-test.md)
- [ ] Add a component id in [the component-libraries.yml](https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/component-libraries.yml)
- [ ] Add a logo in [the UI repo](https://github.com/apache/skywalking-rocketbot-ui/tree/master/src/views/components/topology/assets)
==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👆 ==== -->
<!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
### Improve the performance of <class or module or ...>
- [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking-java/blob/main/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
- [ ] The benchmark result.
```text
<Paste the benchmark results here>
```
- [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
<!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
### <Feature description>
- [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
- [ ] Update the documentation to include this new feature.
- [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
- [ ] If it's UI related, attach the screenshots below.
==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
- [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
- [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking-java/blob/main/CHANGES.md).
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] devkanro edited a comment on pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
devkanro edited a comment on pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#issuecomment-990750517
I have improved the state machine to support #72, check the comment to get more information.
@DominikHubacek @wu-sheng
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#issuecomment-990764979
OK, so, this becomes a hybrid PR. @DominikHubacek Please recheck this PR, and if you don't feel comfortable about this PR will(if merged) be on your name, we could consider other options.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] devkanro commented on pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
devkanro commented on pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#issuecomment-990750517
I have improved the state machine to support #72, check the comment to get more infomation.
@DominikHubacek @wu-sheng
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] devkanro commented on a change in pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
devkanro commented on a change in pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#discussion_r766490405
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -84,6 +84,22 @@ private boolean normalMatch(String pat, int p, String str, int s) {
private boolean wildcardMatch(String pat, int p, String str, int s) {
char pc = safeCharAt(pat, p);
+ // End of pattern, check string only has zero or one '/' at end.
Review comment:
If we get EOS(end of string) when we enter wildcard match state.
We just check the string only has zero or one '/' at end.
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -122,9 +138,11 @@ private boolean wildcardMatch(String pat, int p, String str, int s) {
}
private boolean multiWildcardMatch(String pat, int p, String str, int s) {
- // End of pattern, just check the end of string is '/' quickly.
- if (p >= pat.length() && s < str.length()) {
- return str.charAt(str.length() - 1) != '/';
+ switch (safeCharAt(pat, p)) {
+ // End of pattern, just return true quickly.
+ case 0: return true;
Review comment:
If we get EOS when we enter multi-wildcard match state, return true quickly, because `**` mean anything
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -122,9 +138,11 @@ private boolean wildcardMatch(String pat, int p, String str, int s) {
}
private boolean multiWildcardMatch(String pat, int p, String str, int s) {
- // End of pattern, just check the end of string is '/' quickly.
- if (p >= pat.length() && s < str.length()) {
- return str.charAt(str.length() - 1) != '/';
+ switch (safeCharAt(pat, p)) {
+ // End of pattern, just return true quickly.
+ case 0: return true;
+ // Skip next '/' for pattern to match zero path part.
+ case '/': p++;
Review comment:
Add this branch to support `eureka/**/test` matches `eureka/test` (** means zero path part)
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng merged pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] DominikHubacek commented on pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
DominikHubacek commented on pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#issuecomment-990854860
> OK, so, this becomes a hybrid PR. @DominikHubacek Please recheck this PR, and if you don't feel comfortable about this PR will(if merged) be on your name, we could consider other options.
its ok, I checked if my changes still work as intended and fixed 1 test based on devkanro comment
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] DominikHubacek commented on a change in pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
DominikHubacek commented on a change in pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#discussion_r766578852
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -122,9 +138,11 @@ private boolean wildcardMatch(String pat, int p, String str, int s) {
}
private boolean multiWildcardMatch(String pat, int p, String str, int s) {
- // End of pattern, just check the end of string is '/' quickly.
- if (p >= pat.length() && s < str.length()) {
- return str.charAt(str.length() - 1) != '/';
+ switch (safeCharAt(pat, p)) {
+ // End of pattern, just return true quickly.
+ case 0: return true;
+ // Skip next '/' for pattern to match zero path part.
+ case '/': p++;
Review comment:
> OK, so, this becomes a hybrid PR. @DominikHubacek Please recheck this PR, and if you don't feel comfortable about this PR will(if merged) be on your name, we could consider other options.
its ok, I checked if my changes still work as intended and fixed 1 test based on devkanro comment
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] devkanro commented on a change in pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
devkanro commented on a change in pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#discussion_r766492234
##########
File path: apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/matcher/FastPathMatcher.java
##########
@@ -122,9 +138,11 @@ private boolean wildcardMatch(String pat, int p, String str, int s) {
}
private boolean multiWildcardMatch(String pat, int p, String str, int s) {
- // End of pattern, just check the end of string is '/' quickly.
- if (p >= pat.length() && s < str.length()) {
- return str.charAt(str.length() - 1) != '/';
+ switch (safeCharAt(pat, p)) {
+ // End of pattern, just return true quickly.
+ case 0: return true;
Review comment:
If we get EOS when we enter multi-wildcard match state, return true quickly, because `**` means anything
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#issuecomment-990403505
@devkanro Please help on reviewing this new one.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-java] wu-sheng commented on pull request #81: Fix
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #81:
URL: https://github.com/apache/skywalking-java/pull/81#issuecomment-990858150
Could you two confirm this is good now?
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org