Skip to content

Blockhound: Allow blocking call in kubernetes-client WatchEventsListener - #6287

Open
sh-cho wants to merge 7 commits into
line:mainfrom
sh-cho:kubernetes-client-blocking
Open

Blockhound: Allow blocking call in kubernetes-client WatchEventsListener#6287
sh-cho wants to merge 7 commits into
line:mainfrom
sh-cho:kubernetes-client-blocking

Conversation

@sh-cho

@sh-cho sh-cho commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

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.

@codecov

codecov Bot commented Jun 20, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (8150425) to head (43cf415).
⚠️ Report is 535 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     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@jrhee17

jrhee17 commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

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

@sh-cho

sh-cho commented Jun 23, 2025

Copy link
Copy Markdown
Contributor Author

@jrhee17 Ok let me check

@sh-cho
sh-cho marked this pull request as draft June 23, 2025 12:14
Motivation:
Blockhound detects blocked thread after upgrading kubernetes-client
7.3.1 (line#6271)

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

Signed-off-by: Seonghyeon Cho <seonghyeoncho96@gmail.com>
@sh-cho
sh-cho force-pushed the kubernetes-client-blocking branch from e6f6e37 to a000801 Compare June 23, 2025 12:14
@ikhoon ikhoon added the defect label Jun 24, 2025
@ikhoon ikhoon added this to the 1.33.0 milestone Jun 24, 2025
builder.allowBlockingCallsInside(
"io.fabric8.kubernetes.client.http.StandardHttpRequest$Builder",
"build");
"io.fabric8.kubernetes.client.server.mock.WatchEventsListener", "onClosed");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should work, but I’d prefer not to add test-related code into the production codebase. What do you think about introducing a separate KubernetesTestBlockHoundIntegration class under the test directory?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good :)
I will try it

sh-cho added 3 commits July 1, 2025 23:48
Signed-off-by: Seonghyeon Cho <seonghyeoncho96@gmail.com>
Signed-off-by: Seonghyeon Cho <seonghyeoncho96@gmail.com>
Signed-off-by: Seonghyeon Cho <seonghyeoncho96@gmail.com>
@minwoox
minwoox marked this pull request as ready for review July 3, 2025 02:25

@minwoox minwoox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! 👍 👍 👍

@jrhee17

jrhee17 commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

Sorry, still looks like the blockhound CI is failing

@minwoox

minwoox commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

Oops, let me also take a look.

@minwoox

minwoox commented Jul 4, 2025

Copy link
Copy Markdown
Contributor

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:
reactor/BlockHound#516

Let's wait for their answer. 😉

@ikhoon ikhoon modified the milestones: 1.33.0, 1.34.0 Aug 1, 2025
@github-actions github-actions Bot added Stale and removed Stale labels Aug 31, 2025
@github-actions github-actions Bot removed the Stale label Nov 24, 2025
@github-actions github-actions Bot added Stale and removed Stale labels Dec 27, 2025
@minwoox minwoox modified the milestones: 1.35.0, 1.36.0 Dec 30, 2025
@github-actions github-actions Bot added Stale and removed Stale labels Jan 30, 2026
@ikhoon ikhoon modified the milestones: 1.36.0, 1.37.0 Feb 2, 2026
@github-actions github-actions Bot added Stale and removed Stale labels Mar 5, 2026
@ikhoon ikhoon modified the milestones: 1.38.0, 2.0.0, 1.39.0 Apr 3, 2026
@github-actions github-actions Bot added Stale and removed Stale labels May 4, 2026
@minwoox minwoox modified the milestones: 1.39.0, 1.40.0 May 8, 2026
@github-actions github-actions Bot added the Stale label Jun 10, 2026
@jrhee17 jrhee17 modified the milestones: 1.40.0, 1.41.0 Jun 10, 2026
@github-actions github-actions Bot removed the Stale label Jun 11, 2026
@github-actions github-actions Bot added the Stale label Jul 15, 2026
@mergify

mergify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@ikhoon ikhoon modified the milestones: 1.41.0, 1.42.0 Aug 4, 2026
@mergify

mergify Bot commented Aug 4, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@github-actions github-actions Bot removed the Stale label Aug 6, 2026
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants