milvus icon indicating copy to clipboard operation
milvus copied to clipboard

fix: Prevent deadlock in runComponent when Prepare fails

Open weiliu1031 opened this issue 3 weeks ago • 5 comments

issue: #45068 When component.Prepare() fails (e.g., net listener creation error), the sign channel was never closed, causing runComponent to block indefinitely at <-sign. This resulted in the entire process hanging after logging the error message.

Changes:

  • Move close(sign) to defer statement in runComponent goroutine
  • Ensures sign channel is always closed regardless of success/failure
  • Allows proper error propagation through future.Await() mechanism

weiliu1031 avatar Nov 17 '25 03:11 weiliu1031

[ci-v2-notice] Notice: We are gradually rolling out the new ci-v2 system.

  • Legacy CI jobs remain unaffected, you can just ignore ci-v2 if you don't want to run it.
  • Additional "ci-v2/*" checkers will run for this PR to ensure the new ci-v2 system is working as expected.
  • For tests that exist in both v1 and v2, passing in either system is considered PASS.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-ut-integration // for ci-v2/ut-integration
  • /ci-rerun-ut-go // for ci-v2/ut-go
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp
  • /ci-rerun-e2e-arm // for ci-v2/e2e-arm

If you have any questions or requests, please contact @zhikunyao.

sre-ci-robot avatar Nov 17 '25 03:11 sre-ci-robot

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 76.50%. Comparing base (1ba75ee) to head (939ab43). :warning: Report is 4 commits behind head on master.

:x: Your project status has failed because the head coverage (76.50%) is below the target coverage (77.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #45609      +/-   ##
==========================================
+ Coverage   76.47%   76.50%   +0.02%     
==========================================
  Files        1863     1875      +12     
  Lines      290163   292052    +1889     
==========================================
+ Hits       221889   223420    +1531     
- Misses      60923    61226     +303     
- Partials     7351     7406      +55     
Components Coverage Δ
Client 78.17% <ø> (ø)
Core 83.18% <ø> (ø)
Go 74.61% <ø> (+0.01%) :arrow_up:
see 42 files with indirect coverage changes
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 17 '25 04:11 codecov[bot]

/ci-rerun-ut-go

weiliu1031 avatar Nov 17 '25 07:11 weiliu1031

/ci-rerun-ut-go

weiliu1031 avatar Nov 17 '25 10:11 weiliu1031

/lgtm

chyezh avatar Nov 18 '25 05:11 chyezh

/ci-rerun-ut-go

weiliu1031 avatar Nov 18 '25 06:11 weiliu1031

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: congqixia, weiliu1031

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

sre-ci-robot avatar Nov 18 '25 07:11 sre-ci-robot