You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "xhrg (via GitHub)" <gi...@apache.org> on 2025/09/18 02:24:24 UTC

[I] [Bug] There is a bug in jetty in java-agent [skywalking]

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

   ### 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
   
   OAP server (apache/skywalking)
   
   ### What happened
   
   When using the Jetty client, the application cannot receive the returned data
   
   ### What you expected to happen
   
   When using the Jetty client, the application can receive the returned data
   
   ### How to reproduce
   
   Use the Jetty client to request the HTTP interface and check the response
   
   ### Anything else
   
   AsyncHttpRequestSendInterceptor.java     beforeMethod   below, This is my repair method
   
   `
   if (allArguments[0] instanceof BufferingResponseListener) {
               BufferingResponseListener callback = (BufferingResponseListener) allArguments[0];
               allArguments[0] = new BufferingResponseListenerWrapper(callback, ContextManager.capture());
           } else {
               Response.CompleteListener callback = (Response.CompleteListener) allArguments[0];
               allArguments[0] = new CompleteListenerWrapper(callback, ContextManager.capture());
           }
   `
   
   `
   public class BufferingResponseListenerWrapper extends BufferingResponseListener {
       private BufferingResponseListener callback;
       private ContextSnapshot context;
   
       public BufferingResponseListenerWrapper(BufferingResponseListener callback, ContextSnapshot context) {
           this.callback = callback;
           this.context = context;
       }
   
       @Override
       public void onComplete(Result result) {
           AbstractSpan span = ContextManager.createLocalSpan(Constants.PLUGIN_NAME + "/CompleteListener/onComplete");
           span.setComponent(ComponentsDefine.JETTY_CLIENT);
           SpanLayer.asHttp(span);
           if (context != null) {
               ContextManager.continued(context);
           }
           if (callback != null) {
               callback.onComplete(result);
           }
           ContextManager.stopSpan();
       }
   
       @Override
       public void onHeaders(Response response) {
           callback.onHeaders(response);
       }
   
       @Override
       public void onContent(Response response, ByteBuffer content) {
           callback.onContent(response, content);
       }
   
       @Override
       public void onBegin(Response response) {
           callback.onBegin(response);
       }
   
       @Override
       public boolean onHeader(Response response, HttpField field) {
           return callback.onHeader(response, field);
       }
   
       @Override
       public void onSuccess(Response response) {
           callback.onSuccess(response);
       }
   
       @Override
       public void onFailure(Response response, Throwable failure) {
           callback.onFailure(response, failure);
       }
   }
   `
   
   
    
   
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### 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


Re: [I] [Bug] There is a bug in jetty in java-agent [skywalking]

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

   jetty-client-9.4.42.v20210604
   
   in HttpReceiver.java 
   
   ```
   private ContentListeners(List<Response.ResponseListener> responseListeners)
           {
               listeners = new ArrayList<>(responseListeners.size());
               responseListeners.stream()
                   .filter(Response.DemandedContentListener.class::isInstance)
                   .map(Response.DemandedContentListener.class::cast)
                   .forEach(listeners::add);
           }
   ```
   
   This anonymous object must be an instance of Response.DemandedContentListener.class,
   "onContent" can only be called


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


Re: [I] [Bug] There is a bug in jetty in java-agent [skywalking]

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

   https://github.com/apache/skywalking-java/pull/775


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


Re: [I] [Bug] There is a bug in jetty in java-agent [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed issue #13500: [Bug] There is a bug in jetty in java-agent
URL: https://github.com/apache/skywalking/issues/13500


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


Re: [I] [Bug] There is a bug in jetty in java-agent [skywalking]

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

   Could you be clear about what your fix is? Do you mean you are using `BufferingResponseListener` and it is not supported before?


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


Re: [I] [Bug] There is a bug in jetty in java-agent [skywalking]

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

   I am not completely following. Could you fire the PR and add new versions to the plugin test?


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


Re: [I] [Bug] There is a bug in jetty in java-agent [skywalking]

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

   ok


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