You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "lujiajing1126 (via GitHub)" <gi...@apache.org> on 2023/03/03 10:42:32 UTC

[GitHub] [skywalking] lujiajing1126 opened a new issue, #10479: [Bug] Spring plugins choose wrong interception point to set http status code

lujiajing1126 opened a new issue, #10479:
URL: https://github.com/apache/skywalking/issues/10479

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache SkyWalking Component
   
   Java Agent (apache/skywalking-java)
   
   ### What happened
   
   In the current spring plugin design, status code is extracted from `AbstractMethodInterceptor`
   
   ![image](https://user-images.githubusercontent.com/2568208/222698979-38cd0f05-f819-4fdb-8369-01e4cd6ef2c8.png)
   
   But since the underlying `org.apache.coyote.Response` has  a default value of `200`, it always set `200` to the tag.
   
   The in the `HttpEntityMethodProcessor`, it set the actual value, for example, `201`.
   
   ![image](https://user-images.githubusercontent.com/2568208/222699636-ab112a75-db11-48ed-8bbf-9b71cd6a9b89.png)
   
   So at least for Spring 6.x, the interception point is not correct. I haven't tested Spring 4.x and Spring 5.x.
   
   ### What you expected to happen
   
   We should choose another method to inject http status code.
   
   ### How to reproduce
   
   Run `Spring 6.x scenario` test case locally and debug in your IDE
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] lujiajing1126 commented on issue #10479: [Bug] Spring plugins choose wrong interception point to set http status code

Posted by "lujiajing1126 (via GitHub)" <gi...@apache.org>.
lujiajing1126 commented on issue #10479:
URL: https://github.com/apache/skywalking/issues/10479#issuecomment-1455494877

   > > But since the underlying `org.apache.coyote.Response` has a default value of `200`, it always set `200` to the tag.
   > 
   > Is this true? `200` is a default value and if the status code is not `200`, `org.apache.coyote.Response#getStatusCode` should return other values than `200`. This is what we want, defaulting to `200` unless otherwise set, no?
   
   No. I meant the moment we get status code from `org.apache.coyote.Response#getStatusCode`, it always returns the default value. The actual status code is set latter in `HttpEntityMethodProcessor`. That's the issue.


-- 
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] kezhenxu94 commented on issue #10479: [Bug] Spring plugins choose wrong interception point to set http status code

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on issue #10479:
URL: https://github.com/apache/skywalking/issues/10479#issuecomment-1455394966

   > But since the underlying `org.apache.coyote.Response` has a default value of `200`, it always set `200` to the tag.
   
   Is this true? `200` is a default value and if the status code is not `200`, `org.apache.coyote.Response#getStatusCode` should return other values than `200`. This is what we want, defaulting to `200` unless otherwise set, no?


-- 
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] wu-sheng closed issue #10479: [Bug] Spring plugins choose wrong interception point to set http status code

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed issue #10479: [Bug] Spring plugins choose wrong interception point to set http status code
URL: https://github.com/apache/skywalking/issues/10479


-- 
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] wu-sheng commented on issue #10479: [Bug] Spring plugins choose wrong interception point to set http status code

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on issue #10479:
URL: https://github.com/apache/skywalking/issues/10479#issuecomment-1486243835

   Close for now. No update in a month.


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