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

BlockHound detects kotlinx.coroutines.reactive.ReactiveFlowKt#<clinit> during Mono.awaitFirst() #2190

Closed
okue opened this issue Aug 11, 2020 · 3 comments
Assignees

Comments

@okue
Copy link

okue commented Aug 11, 2020

I'm using BlockHound integration defined in kotlinx-coroutines-debug with reactor.

Problem

When the code Mono#awaitFirst() is executed, BlockHound detected blocking call here:
https://github.com/Kotlin/kotlinx.coroutines/blob/1.3.8/reactive/kotlinx-coroutines-reactive/src/ReactiveFlow.kt#L145

This detection occurs only once or twice after starting my application.
After contextInjector variable is initialized, this detection is not warned any more.

Every time we start the application, BlockHound detects and outputs warning messages, which sounds a little noisy.

versions:

  • Kotlin: 1.3.72
  • kotlinx.coroutines: 1.3.8
  • BlockHound: 1.0.4

Workaround

We can suppress this blocking call.

BlockHound.builder()
    .with(CoroutinesBlockHoundIntegration())
    .allowBlockingCallsInside(
        "kotlinx.coroutines.reactive.ReactiveFlowKt", "<clinit>"
    )

Question

Does BlockHound integration of kotlinx-coroutines-debug have a plan to suppress this kind of warning?

@qwwdfsad
Copy link
Member

Thanks for the report! Suppressing is probably the best option here

@qwwdfsad qwwdfsad self-assigned this Aug 11, 2020
@okue
Copy link
Author

okue commented Aug 11, 2020

Thanks!

@okue
Copy link
Author

okue commented Oct 26, 2020

#2331 resolves this issue.
Thanks @dkhalanskyjb.

@okue okue closed this as completed Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants