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

For each FRU, vpd-manager launches an extra unnecessary asynchronous task(and potentially nested thread) #558

Open
souvik1914581 opened this issue Jan 2, 2025 · 0 comments

Comments

@souvik1914581
Copy link

souvik1914581 commented Jan 2, 2025

Context:

  1. vpd-manager calls Worker::collectFrusFromJson() to parse and publish VPD of all FRUs.
  2. Worker::collectFrusFromJson() iterates through the list of FRUs in System Config JSON and launches a detached thread for VPD collection of each FRU.
  3. Within the body of this detached thread, we are calling std::async with default launch policy, in order to parse and publish the VPD of a FRU in an asynchronous manner. See Worker::collectFrusFromJson()

Issue:

  1. Calling std::async inside the detached thread for a FRU and then collecting the result in a std::future is an unnecessary performance overhead.
  2. Calling std::async without specifying launch policy may potentially launch another thread. See std::async
  3. std::async may throw some exceptions. Worker::collectFrusFromJson() doxygen does not capture this.

As we already have a dedicated detached thread for collecting VPD of a FRU, we should just parse and publish the VPD for this FRU in a synchronous manner from the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant