From 97d356c32cfce5e811d6c9b9b71135bfbb54b7ca Mon Sep 17 00:00:00 2001 From: iryabov Date: Mon, 25 Aug 2025 11:52:40 +0200 Subject: [PATCH 1/6] feat: update transmittable-thread-local dependency fix: improve class loading checks EPMDJ-11057 --- gradle.properties | 2 +- java-agent/build.gradle.kts | 2 -- .../kotlin/com/epam/drill/agent/jvmti/ClassFileLoadHook.kt | 7 +++++-- settings.gradle.kts | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index fa6d10fb..1926729f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ kotlinPoetVersion = 1.9.0 javassistVersion = 3.28.0-GA uuidVersion = 0.3.1 jacocoVersion = 0.8.12 -transmittableThreadLocalVersion = 2.12.2 +transmittableThreadLocalVersion = 2.14.5 shadowPluginVersion = 6.1.0 logbackVersion = 1.2.12 microutilsLoggingVersion = 2.1.23 diff --git a/java-agent/build.gradle.kts b/java-agent/build.gradle.kts index ecd85164..b3bd753f 100644 --- a/java-agent/build.gradle.kts +++ b/java-agent/build.gradle.kts @@ -109,7 +109,6 @@ kotlin { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlinxSerializationVersion") implementation("org.javassist:javassist:$javassistVersion") - implementation("com.alibaba:transmittable-thread-local:$transmittableThreadLocalVersion") implementation("io.aesy:datasize:$aesyDatasizeVersion") implementation("net.bytebuddy:byte-buddy:$bytebuddyVersion") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${kotlinxCoroutinesVersion}") @@ -174,7 +173,6 @@ kotlin { "javassist", "ch.qos.logback", "io.aesy.datasize", - "com.alibaba", "org.slf4j", "org.jacoco", "org.objectweb.asm", diff --git a/java-agent/src/nativeMain/kotlin/com/epam/drill/agent/jvmti/ClassFileLoadHook.kt b/java-agent/src/nativeMain/kotlin/com/epam/drill/agent/jvmti/ClassFileLoadHook.kt index 60202dd1..111af679 100644 --- a/java-agent/src/nativeMain/kotlin/com/epam/drill/agent/jvmti/ClassFileLoadHook.kt +++ b/java-agent/src/nativeMain/kotlin/com/epam/drill/agent/jvmti/ClassFileLoadHook.kt @@ -94,8 +94,11 @@ object ClassFileLoadHook { ) { initRuntimeIfNeeded() val kClassName = clsName?.toKString() ?: return - if (isBootstrapClassLoading(loader, protectionDomain) && !isTlsApp && !isAsyncApp - && !kClassName.contains("Http") // raw hack for http(s) classes + if (isBootstrapClassLoading(loader, protectionDomain) && !when { + kClassName.contains("Http") -> true // raw hack for Http(s) URL Connection classes + kClassName in TTLTransformer.directTtlClasses -> true + else -> false + } ) return if (classData == null || kClassName.startsWith(DRILL_PACKAGE)) return try { diff --git a/settings.gradle.kts b/settings.gradle.kts index 8d189ccf..1bee3210 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -41,6 +41,7 @@ includeSharedLib("agent-instrumentation") includeSharedLib("jvmapi") includeSharedLib("knasm") includeSharedLib("konform") +includeSharedLib("transmittable-thread-local") // FYI: Interceptor not patched for macOS ARM64 architecture. //includeSharedLib("interceptor-hook") //includeSharedLib("interceptor-http") @@ -50,3 +51,4 @@ includeSharedLib("test2code-common") include("test2code-jacoco") include("test2code") include("java-agent") + From 7f93c1b90623a3bdaecb0de36142b587a93bb593 Mon Sep 17 00:00:00 2001 From: iryabov Date: Mon, 25 Aug 2025 11:55:37 +0200 Subject: [PATCH 2/6] build: update sharedLibsRef to point to feature branch --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 1926729f..f12e817f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ apacheHttpClientVersion = 5.2.3 aesyDatasizeVersion = 1.0.0 bytebuddyVersion = 1.14.11 -sharedLibsRef = main +sharedLibsRef = feature/transmittable-thread-local-EPMDJ-11057 sharedLibsLocalPath = lib-jvm-shared nativeAgentLibName = drill-agent nativeAgentHookEnabled = false From 29b6ba415dcd4ba4a4c3826cea11467600ef35e8 Mon Sep 17 00:00:00 2001 From: iryabov Date: Mon, 25 Aug 2025 15:16:15 +0200 Subject: [PATCH 3/6] build: remove gradle/wrapper-validation-action from release.yml --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6ce4605..cc91dca8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,7 +121,6 @@ jobs: with: java-version: 8.0 distribution: zulu - - uses: gradle/wrapper-validation-action@v1 - run: chmod +x ${{ github.workspace }}/gradlew - run: chmod +x ${{ github.workspace }}/setup-shared-libs.sh - run: ${{ github.workspace }}/setup-shared-libs.sh From 98303860a1514c70a1464db4dbb70156438df51f Mon Sep 17 00:00:00 2001 From: iryabov Date: Mon, 25 Aug 2025 15:18:16 +0200 Subject: [PATCH 4/6] build: remove gradle/wrapper-validation-action from release.yml --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc91dca8..54deaad3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,6 @@ jobs: with: java-version: 8.0 distribution: zulu - - uses: gradle/wrapper-validation-action@v1 - if: matrix.config.preset == 'linuxX64' || matrix.config.preset == 'macosX64' || matrix.config.preset == 'macosArm64' run: chmod +x ${{ github.workspace }}/gradlew - if: matrix.config.preset == 'linuxX64' || matrix.config.preset == 'macosX64' || matrix.config.preset == 'macosArm64' @@ -89,7 +88,6 @@ jobs: with: java-version: 8.0 distribution: zulu - - uses: gradle/wrapper-validation-action@v1 - if: matrix.config.preset == 'linuxX64' || matrix.config.preset == 'macosX64' || matrix.config.preset == 'macosArm64' run: chmod +x ${{ github.workspace }}/gradlew - if: matrix.config.preset == 'linuxX64' || matrix.config.preset == 'macosX64' || matrix.config.preset == 'macosArm64' From 001066a52f1011bacdfbf790c2502c2c69875f5b Mon Sep 17 00:00:00 2001 From: iryabov Date: Mon, 25 Aug 2025 15:22:09 +0200 Subject: [PATCH 5/6] build: remove gradle/wrapper-validation-action from release.yml --- .github/workflows/check.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9d645242..c0260c9e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -22,7 +22,6 @@ jobs: with: java-version: 8 distribution: zulu - - uses: gradle/wrapper-validation-action@v1 - if: matrix.config.preset == 'linuxX64' || matrix.config.preset == 'macosX64' || matrix.config.preset == 'macosArm64' run: chmod +x ${{ github.workspace }}/gradlew - if: matrix.config.preset == 'linuxX64' || matrix.config.preset == 'macosX64' || matrix.config.preset == 'macosArm64' From d3b819348c7ddab32a55ee473477fba25082b7df Mon Sep 17 00:00:00 2001 From: iryabov Date: Tue, 26 Aug 2025 11:48:02 +0200 Subject: [PATCH 6/6] build: update sharedLibsRef to point to main branch --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index f12e817f..1926729f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ apacheHttpClientVersion = 5.2.3 aesyDatasizeVersion = 1.0.0 bytebuddyVersion = 1.14.11 -sharedLibsRef = feature/transmittable-thread-local-EPMDJ-11057 +sharedLibsRef = main sharedLibsLocalPath = lib-jvm-shared nativeAgentLibName = drill-agent nativeAgentHookEnabled = false