Skip to content

Update BlockHound version to be compatible with JDK 17 #3771

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

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ javafx_version=17.0.2
javafx_plugin_version=0.0.8
binary_compatibility_validator_version=0.12.0
kover_version=0.7.0-Beta
blockhound_version=1.0.2.RELEASE
blockhound_version=1.0.8.RELEASE
jna_version=5.9.0

# Android versions
Expand All @@ -49,9 +49,6 @@ jsdom_global_version=3.0.2
kotlin.incremental.multiplatform=true
kotlin.native.ignoreDisabledTargets=true

# Site generation
jekyll_version=4.0

# JS IR backend sometimes crashes with out-of-memory
# TODO: Remove once KT-37187 is fixed
org.gradle.jvmargs=-Xmx3g
Expand Down
2 changes: 1 addition & 1 deletion kotlinx-coroutines-debug/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ of coroutines hierarchy referenced by a [Job] or [CoroutineScope] instances usin
This module also provides an automatic [BlockHound](https://github.com/reactor/BlockHound) integration
that detects when a blocking operation was called in a coroutine context that prohibits it. In order to use it,
please follow the BlockHound [quick start guide](
https://github.com/reactor/BlockHound/blob/1.0.2.RELEASE/docs/quick_start.md).
https://github.com/reactor/BlockHound/blob/1.0.8.RELEASE/docs/quick_start.md).

### Using in your project

Expand Down
7 changes: 7 additions & 0 deletions kotlinx-coroutines-debug/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ java {
disableAutoTargetJvm()
}

// This is required for BlockHound tests to work, see https://github.com/Kotlin/kotlinx.coroutines/issues/3701
tasks.withType(Test).configureEach {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
jvmArgs += ["-XX:+AllowRedefinitionToAddDeleteMethods"]
}
}

jar {
setEnabled(false)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2016-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
Expand All @@ -10,6 +10,9 @@ import kotlinx.coroutines.scheduling.*
import reactor.blockhound.*
import reactor.blockhound.integration.*

/**
* @suppress
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing this, I began to wonder whether we should document the class instead since it is possible to sidestep the ServiceLoader mechanism with BlockHound and apply the integrations manually, but it looks like nobody actually uses the integration by name (https://github.com/search?q=CoroutinesBlockHoundIntegration&type=code), and it's not expected that the integrations will be documented (https://github.com/reactor/BlockHound/tree/master/agent/src/main/java/reactor/blockhound/integration), so ok.

*/
public class CoroutinesBlockHoundIntegration : BlockHoundIntegration {

override fun applyTo(builder: BlockHound.Builder): Unit = with(builder) {
Expand Down