Skip to content
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

enhance: Mark cgo thread with tag name #38000

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

congqixia
Copy link
Contributor

Related to #37999

This PR add SetThreadName API for marking cgo thread and utilize it when initializing cgo worker.

@congqixia congqixia changed the title enhance: Mark cgo thread wit tag name enhance: Mark cgo thread with tag name Nov 25, 2024
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: congqixia

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 sre-ci-robot added approved size/M Denotes a PR that changes 30-99 lines. labels Nov 25, 2024
@mergify mergify bot added dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement labels Nov 25, 2024
conc.WithPreHandler(runtime.LockOSThread), // lock os thread for cgo thread disposal
conc.WithPreHandler(func() {
runtime.LockOSThread()
C.SetThreadName(cgoTagDynamic)
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this a mandatory param?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WithPreHandler?Since its a general worker pool, it is not recommend to make CGO related params mandatory

Copy link
Contributor

mergify bot commented Nov 25, 2024

@congqixia go-sdk check failed, comment rerun go-sdk can trigger the job again.

Copy link
Contributor

mergify bot commented Nov 25, 2024

@congqixia E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Related to milvus-io#37999

This PR add `SetThreadName` API for marking cgo thread and utilize it
when initializing cgo worker.

Signed-off-by: Congqi Xia <[email protected]>
Signed-off-by: Congqi Xia <[email protected]>
@congqixia congqixia force-pushed the enhance/mark_cgo_thread_name branch from 5ee2f2d to b339976 Compare November 25, 2024 12:19
Copy link
Contributor

mergify bot commented Nov 25, 2024

@congqixia go-sdk check failed, comment rerun go-sdk can trigger the job again.

Copy link
Contributor

mergify bot commented Nov 25, 2024

@congqixia cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.

Copy link
Contributor

mergify bot commented Nov 25, 2024

@congqixia E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

@congqixia
Copy link
Contributor Author

rerun cpp-unit-test

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 68.18182% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.07%. Comparing base (27c22d1) to head (b339976).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
internal/querynodev2/segments/pool.go 78.94% 3 Missing and 1 partial ⚠️
internal/core/src/segcore/segcore_init_c.cpp 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #38000       +/-   ##
===========================================
+ Coverage   68.87%   81.07%   +12.19%     
===========================================
  Files         289     1360     +1071     
  Lines       25481   190781   +165300     
===========================================
+ Hits        17551   154671   +137120     
- Misses       7930    30627    +22697     
- Partials        0     5483     +5483     
Components Coverage Δ
Client 72.33% <ø> (∅)
Core 68.87% <0.00%> (-0.01%) ⬇️
Go 83.24% <78.94%> (∅)
Files with missing lines Coverage Δ
internal/core/src/segcore/segcore_init_c.cpp 38.77% <0.00%> (-2.53%) ⬇️
internal/querynodev2/segments/pool.go 91.30% <78.94%> (ø)

... and 1070 files with indirect coverage changes

@congqixia
Copy link
Contributor Author

rerun go-sdk

@congqixia
Copy link
Contributor Author

/run-cpu-e2e

Copy link
Contributor

mergify bot commented Nov 25, 2024

@congqixia E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

@congqixia
Copy link
Contributor Author

/run-cpu-e2e

@mergify mergify bot added the ci-passed label Nov 25, 2024
Copy link
Member

@liliu-z liliu-z left a comment

Choose a reason for hiding this comment

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

Talked offline, we can merge this code for now but some questions need to be taken care of:

  1. How to name OS thread in go side
  2. Name need to be passed to TP's constructor after we find a way to name both cgo threads and go side threads
  3. Why these many singleton, can we cut down some of them?
    /lgtm

@sre-ci-robot sre-ci-robot merged commit cb65423 into milvus-io:master Nov 26, 2024
18 of 20 checks passed
congqixia added a commit to congqixia/milvus that referenced this pull request Nov 26, 2024
Related to milvus-io#37999

This PR add `SetThreadName` API for marking cgo thread and utilize it
when initializing cgo worker.

---------

Signed-off-by: Congqi Xia <[email protected]>
JsDove pushed a commit to JsDove/milvus that referenced this pull request Nov 26, 2024
Related to milvus-io#37999

This PR add `SetThreadName` API for marking cgo thread and utilize it
when initializing cgo worker.

---------

Signed-off-by: Congqi Xia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved ci-passed dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement lgtm size/M Denotes a PR that changes 30-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants