You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wangbaobisheng (via GitHub)" <gi...@apache.org> on 2023/06/25 07:44:56 UTC

[GitHub] [skywalking] wangbaobisheng opened a new issue, #10991: [Bug] intercept failure

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

   ### 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
   
   skywalking logs like this:
   ERROR 2023-06-25 15:29:34:514 reactor-http-epoll-2 InstMethodsInter : class[class reactor.netty.http.client.HttpClientFinalizer] after method[uri] intercept failure 
   java.lang.ClassCastException
   
   ERROR 2023-06-25 15:29:34:514 reactor-http-epoll-2 InstMethodsInterWithOverrideArgs : class[class reactor.netty.http.client.HttpClientFinalizer] before method[send] intercept failure 
   java.lang.ClassCastException
   
   ERROR 2023-06-25 15:29:34:514 reactor-http-epoll-2 InstMethodsInterWithOverrideArgs : class[class reactor.netty.http.client.HttpClientFinalizer] before method[responseConnection] intercept failure 
   java.lang.ClassCastException
   
   ERROR 2023-06-25 15:29:34:518 reactor-http-epoll-6 InstMethodsInter : class[class reactor.netty.http.client.HttpClientFinalizer] after method[uri] intercept failure 
   java.lang.ClassCastException
   
   ERROR 2023-06-25 15:29:34:518 reactor-http-epoll-6 InstMethodsInterWithOverrideArgs : class[class reactor.netty.http.client.HttpClientFinalizer] before method[send] intercept failure 
   java.lang.ClassCastException
   
   ERROR 2023-06-25 15:29:34:518 reactor-http-epoll-6 InstMethodsInterWithOverrideArgs : class[class reactor.netty.http.client.HttpClientFinalizer] before method[responseConnection] intercept failure 
   java.lang.ClassCastException
   
   ### What you expected to happen
   
   /*
    * Copyright (c) 2017-2021 VMware, Inc. or its affiliates, All Rights Reserved.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    *   https://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
   package reactor.netty.http.client;
   
   import java.net.URI;
   import java.util.Objects;
   import java.util.function.BiConsumer;
   import java.util.function.BiFunction;
   import java.util.function.Consumer;
   import java.util.function.Function;
   
   import io.netty.buffer.ByteBuf;
   import io.netty.buffer.ByteBufAllocator;
   import io.netty.channel.ChannelOption;
   import org.reactivestreams.Publisher;
   import reactor.core.publisher.Flux;
   import reactor.core.publisher.Mono;
   import reactor.netty.ByteBufFlux;
   import reactor.netty.ByteBufMono;
   import reactor.netty.Connection;
   import reactor.netty.NettyOutbound;
   import reactor.netty.channel.ChannelOperations;
   import reactor.util.annotation.Nullable;
   
   /**
    * Configures the HTTP request before calling one of the terminal,
    * {@link Publisher} based, {@link ResponseReceiver} API.
    *
    * @author Stephane Maldini
    * @author Violeta Georgieva
    */
   final class HttpClientFinalizer extends HttpClientConnect implements HttpClient.RequestSender {
   
   	HttpClientFinalizer(HttpClientConfig config) {
   		super(config);
   	}
   
   	// UriConfiguration methods
   
   	@Override
   	public HttpClient.RequestSender uri(Mono<String> uri) {
   		Objects.requireNonNull(uri, "uri");
   		HttpClient dup = duplicate();
   		dup.configuration().deferredConf(config -> uri.map(s -> {
   			config.uriStr = s;
   			config.uri = null;
   			return config;
   		}));
   		return (HttpClientFinalizer) dup;
   	}
   
   	@Override
   	public HttpClient.RequestSender uri(String uri) {
   		Objects.requireNonNull(uri, "uri");
   		HttpClient dup = duplicate();
   		dup.configuration().uriStr = uri;
   		dup.configuration().uri = null;
   		return (HttpClientFinalizer) dup;
   	}
   
   	@Override
   	public RequestSender uri(URI uri) {
   		Objects.requireNonNull(uri, "uri");
   		if (!uri.isAbsolute()) {
   			throw new IllegalArgumentException("URI is not absolute: " + uri);
   		}
   		HttpClient dup = duplicate();
   		dup.configuration().uriStr = null;
   		dup.configuration().uri = uri;
   		return (HttpClientFinalizer) dup;
   	}
   
   	// ResponseReceiver methods
   
   	@Override
   	public Mono<HttpClientResponse> response() {
   		return _connect().map(RESPONSE_ONLY);
   	}
   
   	@Override
   	public <V> Flux<V> response(BiFunction<? super HttpClientResponse, ? super ByteBufFlux, ? extends Publisher<V>> receiver) {
   		return _connect().flatMapMany(resp -> Flux.from(receiver.apply(resp, resp.receive()))
   		                                          .doFinally(s -> discard(resp)));
   	}
   
   	@Override
   	public <V> Flux<V> responseConnection(BiFunction<? super HttpClientResponse, ? super Connection, ? extends Publisher<V>> receiver) {
   		return _connect().flatMapMany(resp -> Flux.from(receiver.apply(resp, resp)));
   	}
   
   	@Override
   	public ByteBufFlux responseContent() {
   		ByteBufAllocator alloc = (ByteBufAllocator) configuration().options()
   		                                                           .get(ChannelOption.ALLOCATOR);
   		if (alloc == null) {
   			alloc = ByteBufAllocator.DEFAULT;
   		}
   
   		@SuppressWarnings("unchecked")
   		Mono<ChannelOperations<?, ?>> connector = (Mono<ChannelOperations<?, ?>>) connect();
   		return ByteBufFlux.fromInbound(connector.flatMapMany(contentReceiver), alloc);
   	}
   
   	@Override
   	public <V> Mono<V> responseSingle(BiFunction<? super HttpClientResponse, ? super ByteBufMono, ? extends Mono<V>> receiver) {
   		return _connect().flatMap(resp -> receiver.apply(resp, resp.receive().aggregate())
   		                                          .doFinally(s -> discard(resp)));
   	}
   
   	// RequestSender methods
   
   	@Override
   	public HttpClientFinalizer send(
   			BiFunction<? super HttpClientRequest, ? super NettyOutbound, ? extends Publisher<Void>> sender) {
   		Objects.requireNonNull(sender, "requestBody");
   		HttpClient dup = duplicate();
   		dup.configuration().body = sender;
   		return (HttpClientFinalizer) dup;
   	}
   
   	@Override
   	public HttpClientFinalizer send(Publisher<? extends ByteBuf> requestBody) {
   		Objects.requireNonNull(requestBody, "requestBody");
   		return send((req, out) -> out.send(requestBody));
   	}
   
   	@Override
   	public HttpClientFinalizer sendForm(BiConsumer<? super HttpClientRequest, HttpClientForm> formCallback, @Nullable Consumer<Flux<Long>> progress) {
   		Objects.requireNonNull(formCallback, "formCallback");
   		return send((req, out) -> {
   			HttpClientOperations ops = (HttpClientOperations) out;
   			return new HttpClientOperations.SendForm(ops, formCallback, progress);
   		});
   	}
   
   	@Override
   	protected HttpClient duplicate() {
   		return new HttpClientFinalizer(new HttpClientConfig(config));
   	}
   
   	@SuppressWarnings("unchecked")
   	Mono<HttpClientOperations> _connect() {
   		return (Mono<HttpClientOperations>) connect();
   	}
   
   	static void discard(HttpClientOperations c) {
   		if (!c.isInboundDisposed()) {
   			c.discard();
   		}
   	}
   
   	static final Function<ChannelOperations<?, ?>, Publisher<ByteBuf>> contentReceiver = ChannelOperations::receive;
   
   	static final Function<HttpClientOperations, HttpClientResponse> RESPONSE_ONLY = ops -> {
   		//defer the dispose to avoid over disposing on receive
   		discard(ops);
   		return ops;
   	};
   }
   
   
   
   ### How to reproduce
   
   skywalking produces lots of errors
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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] wangbaobisheng commented on issue #10991: [Bug] intercept failure

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

   My question is why skywalking cannot proxy reactor.netty.http.client.HttpClientFinalizer,
   isn't that a problem?


-- 
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] intercept failure [skywalking]

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

   Hi, @wangbaobisheng . Looks like I'm having the same problem, how did you solve it?


-- 
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 #10991: [Bug] intercept failure

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

   We don't know whether this is a problem. You put some codes on your product env, then something happens. 
   Then, you expect we somehow magically know. what happened there? Really? How is that possible? And why should we take time to do the research on an env we never know? 
   
   Learn how to take with a community. An error shows up, so what? Every codebase shows countless error logs.
   
   An open-source community doesn't have an obligation to do anything for you. We take our own time and charge nothing for you. 


-- 
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] intercept failure [skywalking]

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

   @huange7 @andyyyf It seems like plugins conflict, check and removing can resolve this problem.


-- 
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] intercept failure [skywalking]

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

   > @huange7 @andyyyf It seems like plugins conflict, check and removing can resolve this problem.
   @wongtp  I have the save problem。oap(9.6.0)   agent(9.0.0)
   The plugins , apm-spring-cloud-gateway-3.x-plugin-9.0.0.jar and apm-spring-webflux-5.x-plugin-9.0.0.jar (optional-plugins) are used.
   How can I check the plugins? And find the conflicting plugin.  
   thank you!


-- 
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 #10991: [Bug] intercept failure

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

   First, we only discuss in English on GitHub. Then, your product env is your responsibility. We don't provide debugging for you.


-- 
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] intercept failure [skywalking]

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

   @wangbaobisheng  i hava the some problem, how do you fix this problem


-- 
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 #10991: [Bug] intercept failure

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

   No context. I don't know what is this about.


-- 
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 #10991: [Bug] intercept failure

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed issue #10991: [Bug] intercept failure 
URL: https://github.com/apache/skywalking/issues/10991


-- 
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] wangbaobisheng commented on issue #10991: [Bug] intercept failure

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

   skywalking version 8.8.0


-- 
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] wangbaobisheng commented on issue #10991: [Bug] intercept failure

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

   项目中使用skywalking产生大量日志报错,从而生成大量日志文件,文件名类似skywalking-api.log.2023_06_25_15_33_58,文件中的报错的内容如下所示:
   ERROR 2023-06-25 15:29:34:099 reactor-http-epoll-2 InstMethodsInter : class[class reactor.netty.http.client.HttpClientFinalizer] after method[uri] intercept failure 
   java.lang.ClassCastException
   
   ERROR 2023-06-25 15:29:34:099 reactor-http-epoll-2 InstMethodsInterWithOverrideArgs : class[class reactor.netty.http.client.HttpClientFinalizer] before method[send] intercept failure 
   java.lang.ClassCastException
   
   ERROR 2023-06-25 15:29:34:099 reactor-http-epoll-2 InstMethodsInterWithOverrideArgs : class[class reactor.netty.http.client.HttpClientFinalizer] before method[responseConnection] intercept failure 
   
   
   分析:看上去无法对reactor.netty.http.client.HttpClientFinalizer进行代理,reactor.netty.http.client.HttpClientFinalizer的代码上文已经给出


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