armeria icon indicating copy to clipboard operation
armeria copied to clipboard

Blockhound: Allow blocking call in kubernetes-client `WatchEventsListener`

Open sh-cho opened this issue 6 months ago • 7 comments

Motivation: Blockhound detects blocked thread after upgrading kubernetes-client 7.3.1 (#6271, https://github.com/line/armeria/actions/runs/15771639756/job/44457567699)

Modification:

  • Remove io.fabric8.kubernetes.client.http.StandardHttpRequest$Builder from allow list, as it uses UUID created via AtomicLong now.
  • Add io.fabric8.kubernetes.client.server.mock.WatchEventsListener to allow list, because it is only used in the mock server.

Result: Blockhound passes.

sh-cho avatar Jun 20 '25 16:06 sh-cho

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 0.00%. Comparing base (8150425) to head (43cf415). :warning: Report is 215 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #6287       +/-   ##
============================================
- Coverage     74.46%       0   -74.47%     
============================================
  Files          1963       0     -1963     
  Lines         82437       0    -82437     
  Branches      10764       0    -10764     
============================================
- Hits          61385       0    -61385     
+ Misses        15918       0    -15918     
+ Partials       5134       0     -5134     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 20 '25 16:06 codecov[bot]

🔍 Build Scan® (commit: 43cf4155369db6fb71042976d59a4d62b0b2f01a)

Job name Status Build Scan®
build-ubicloud-standard-16-jdk-8 https://ge.armeria.dev/s/zf67d2j6ftkrw
build-ubicloud-standard-16-jdk-21-snapshot-blockhound ❌ (failure) https://ge.armeria.dev/s/tpga4zkhd65sc
build-ubicloud-standard-16-jdk-17-min-java-17-coverage https://ge.armeria.dev/s/wlfs3fpd76jis
build-ubicloud-standard-16-jdk-17-min-java-11 ❌ (failure) https://ge.armeria.dev/s/2ct3fmiltivlk
build-ubicloud-standard-16-jdk-17-leak https://ge.armeria.dev/s/e3mtplt2ujrdi
build-ubicloud-standard-16-jdk-11 https://ge.armeria.dev/s/zia3qdhptyrqg
build-macos-latest-jdk-21 https://ge.armeria.dev/s/meztrwxfajcrm

github-actions[bot] avatar Jun 20 '25 17:06 github-actions[bot]

It looks like the CI is still failing due to a blocking call. Can you check this?

jrhee17 avatar Jun 23 '25 01:06 jrhee17

@jrhee17 Ok let me check

sh-cho avatar Jun 23 '25 12:06 sh-cho

Sorry, still looks like the blockhound CI is failing

jrhee17 avatar Jul 03 '25 02:07 jrhee17

Oops, let me also take a look.

minwoox avatar Jul 03 '25 02:07 minwoox

After we update the version from 6.x to 7.x, the test suite uses the embedded Vert.x server: https://github.com/fabric8io/kubernetes-client/blob/ed36981b306116d0c896e53ec4f7a04c2a065a72/doc/MIGRATION-v7.md?plain=1#L26

Vert.x utilizes FastThreadLocalThread for its blocking worker threads which are classified as non-blocking by Netty's BlockHoundIntegration. In order to solve this issue, I left my suggestion to the block hound: https://github.com/reactor/BlockHound/issues/516

Let's wait for their answer. 😉

minwoox avatar Jul 04 '25 03:07 minwoox