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 2022/10/18 07:41:26 UTC

[GitHub] [skywalking-java] guillaume-alvarez opened a new pull request, #353: Closes #9800, wait for transaction end to close span.

guillaume-alvarez opened a new pull request, #353:
URL: https://github.com/apache/skywalking-java/pull/353

   Wait until the end of the transaction before closing the transaction span, like it is done for NetworkSession.asyncRun calls.
   
   ### Fix #9800
   - [] Add a unit test to verify that the fix works.
   - [x] Explain briefly why the bug exists and how to fix it.
   
   - [X] 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] guillaume-alvarez commented on a diff in pull request #353: Closes #9800, wait for transaction end to close span.

Posted by GitBox <gi...@apache.org>.
guillaume-alvarez commented on code in PR #353:
URL: https://github.com/apache/skywalking-java/pull/353#discussion_r997953027


##########
apm-sniffer/apm-sdk-plugin/neo4j-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/neo4j/v4x/TransactionRunInterceptor.java:
##########
@@ -61,13 +61,15 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
     @Override
     public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
             Object ret) throws Throwable {
-        SessionRequiredInfo requiredInfo = (SessionRequiredInfo) objInst.getSkyWalkingDynamicField();
-        if (requiredInfo == null || requiredInfo.getSpan() == null) {
-            return ret;
-        }
+        return ((CompletionStage<?>) ret).thenApply(resultCursor -> {

Review Comment:
   It worked much better on Linux!
   I cleaned the commits, sorry for the noise.



-- 
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 a diff in pull request #353: Closes #9800, wait for transaction end to close span.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #353:
URL: https://github.com/apache/skywalking-java/pull/353#discussion_r997868632


##########
apm-sniffer/apm-sdk-plugin/neo4j-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/neo4j/v4x/TransactionRunInterceptor.java:
##########
@@ -61,13 +61,15 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
     @Override
     public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
             Object ret) throws Throwable {
-        SessionRequiredInfo requiredInfo = (SessionRequiredInfo) objInst.getSkyWalkingDynamicField();
-        if (requiredInfo == null || requiredInfo.getSpan() == null) {
-            return ret;
-        }
+        return ((CompletionStage<?>) ret).thenApply(resultCursor -> {

Review Comment:
   That could be fixed through git setup, I remember this is a kind of issue on Windows?



-- 
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] guillaume-alvarez commented on a diff in pull request #353: Closes #9800, wait for transaction end to close span.

Posted by GitBox <gi...@apache.org>.
guillaume-alvarez commented on code in PR #353:
URL: https://github.com/apache/skywalking-java/pull/353#discussion_r997953027


##########
apm-sniffer/apm-sdk-plugin/neo4j-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/neo4j/v4x/TransactionRunInterceptor.java:
##########
@@ -61,13 +61,15 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
     @Override
     public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
             Object ret) throws Throwable {
-        SessionRequiredInfo requiredInfo = (SessionRequiredInfo) objInst.getSkyWalkingDynamicField();
-        if (requiredInfo == null || requiredInfo.getSpan() == null) {
-            return ret;
-        }
+        return ((CompletionStage<?>) ret).thenApply(resultCursor -> {

Review Comment:
   It worked much better on Linux!
   I cleaned the commits.



-- 
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 a diff in pull request #353: Closes #9800, wait for transaction end to close span.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #353:
URL: https://github.com/apache/skywalking-java/pull/353#discussion_r997992854


##########
CHANGES.md:
##########
@@ -16,6 +16,7 @@ Release Notes.
 * Update `compose-start-script.template` to make compatible with new version docker compose
 * Bump up grpc to 1.50.0 to fix CVE-2022-3171
 * Polish up nats plugin to unify MQ related tags  
+* Accurate duration of the transaction span for Neo4J 4.x.

Review Comment:
   ```suggestion
   * Correct the duration of the transaction span for Neo4J 4.x.
   ```



-- 
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 #353: Closes #9800, wait for transaction end to close span.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #353:
URL: https://github.com/apache/skywalking-java/pull/353#issuecomment-1281954122

   @wallezhang PTAL.


-- 
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] guillaume-alvarez commented on a diff in pull request #353: Closes #9800, wait for transaction end to close span.

Posted by GitBox <gi...@apache.org>.
guillaume-alvarez commented on code in PR #353:
URL: https://github.com/apache/skywalking-java/pull/353#discussion_r997871568


##########
apm-sniffer/apm-sdk-plugin/neo4j-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/neo4j/v4x/TransactionRunInterceptor.java:
##########
@@ -61,13 +61,15 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
     @Override
     public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
             Object ret) throws Throwable {
-        SessionRequiredInfo requiredInfo = (SessionRequiredInfo) objInst.getSkyWalkingDynamicField();
-        if (requiredInfo == null || requiredInfo.getSpan() == null) {
-            return ret;
-        }
+        return ((CompletionStage<?>) ret).thenApply(resultCursor -> {

Review Comment:
   Indeed I'm on Windows, I just checked it out on linux to see if it works more smoothly.



-- 
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 a diff in pull request #353: Closes #9800, wait for transaction end to close span.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #353:
URL: https://github.com/apache/skywalking-java/pull/353#discussion_r997992092


##########
CHANGES.md:
##########
@@ -16,6 +16,7 @@ Release Notes.
 * Update `compose-start-script.template` to make compatible with new version docker compose
 * Bump up grpc to 1.50.0 to fix CVE-2022-3171
 * Polish up nats plugin to unify MQ related tags  
+* Fix transaction spans for Neo4J 4.x.

Review Comment:
   ```suggestion
   * Accurate duration of the transaction span for Neo4J 4.x.
   ```



-- 
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 #353: Correct the duration of the transaction span for Neo4J 4.x

Posted by GitBox <gi...@apache.org>.
wu-sheng merged PR #353:
URL: https://github.com/apache/skywalking-java/pull/353


-- 
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 a diff in pull request #353: Closes #9800, wait for transaction end to close span.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #353:
URL: https://github.com/apache/skywalking-java/pull/353#discussion_r997850337


##########
apm-sniffer/apm-sdk-plugin/neo4j-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/neo4j/v4x/TransactionRunInterceptor.java:
##########
@@ -61,13 +61,15 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
     @Override
     public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
             Object ret) throws Throwable {
-        SessionRequiredInfo requiredInfo = (SessionRequiredInfo) objInst.getSkyWalkingDynamicField();
-        if (requiredInfo == null || requiredInfo.getSpan() == null) {
-            return ret;
-        }
+        return ((CompletionStage<?>) ret).thenApply(resultCursor -> {

Review Comment:
   @guillaume-alvarez I think we face compiling error for the change. This is no `import`ed? Please make compiling passed locally first.



-- 
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