Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update java exception rules to support reactor/webflux formatted exception #87

Open
sethrylan opened this issue Sep 2, 2021 · 0 comments · May be fixed by #88
Open

Update java exception rules to support reactor/webflux formatted exception #87

sethrylan opened this issue Sep 2, 2021 · 0 comments · May be fixed by #88

Comments

@sethrylan
Copy link

Steps to reproduce

  1. Configure fluent-plugin-detect-exceptions
    <match raw.kubernetes.**>
      @id exceptions
      @type detect_exceptions
      remove_tag_prefix raw
      message message
      stream stream
      multiline_flush_interval 5
      max_bytes 500000
      max_lines 1000
    </match>
  1. Create an exception on a reactive thread. These exceptions follow the format
org.springframework.web.reactive.function.client.WebClientRequestException: finishConnect(..) failed: Connection refused: localhost:8080; nested exception is io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost:8080
	at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141)
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
	|_ checkpoint ⇢ Request to GET localhost:8080
Stack trace:
		at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141)
		at reactor.core.publisher.MonoErrorSupplied.subscribe(MonoErrorSupplied.java:70)
		at reactor.core.publisher.Mono.subscribe(Mono.java:4150)
		at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103)
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95)
		at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:221)
		at java.lang.Thread.run(Thread.java:834)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost:8080
Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
	at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155)
	at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128)
	at io.netty.channel.unix.Socket.finishConnect(Socket.java:278)
	at java.lang.Thread.run(Thread.java:834)

Results seen

The exception is logged on multiple lines. E.g.,

{ "message": "[2021-09-02 12:57:32:721] [sba-service_v1,,,] [\u001b[33mWARN \u001b[m] - [     parallel-1] d.c.b.a.s.s.InfoUpdater        - Couldn't retrieve info for Instance(id=4189dc1b3bbe, version=3, ....))\n",...}
{ "message": "java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 10000ms in 'map' (and no fallback has been configured)\n\tat reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.handleTimeout(FluxTimeout.java:295) ~[reactor-core-3.4.8.jar:3.4.8]\n\tSuppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: \n",...}
{ "message": "\t|_ checkpoint ⇢ Request to GET info [DefaultWebClient]\n",...}
{ "message": "Stack trace:\n",...}

(the above example is truncated and formatted for readability)

Results expected

The exception should be combined into a single message.

Related defects

The example above also has the first line of logger output (e.g., [2021-09-02 12:57:32:721] [sba-service_v1,,,] ...) separate, which is caused by #73 and #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant