Remove redundant async call in collection threads
This commit removes the redundant std:async call in the detached thread
launched for parsing and publishing the VPD for an individual FRU. Since
we have a dedicated detached thread for each FRU, we can do VPD parse
and publish in a synchronous manner from the detached thread itself,
instead of launching a asynchronous task which adds unnecessary
performance cost. This commit also handles any exception thrown while
launching the detached thread for a FRU. In case launching detached
thread for a FRU fails, we add the EEPROM path of the FRU to a "failed
EEPROM" list. This list can be handled by Manager later on.
Test:
```
- Install bitbaked image on Everest system.
- Check vpd-manager service status:
root@p10bmc:~# systemctl show vpd-manager -p NRestarts
NRestarts=0
- Check BMC reaches ready state:
root@p10bmc:~# obmcutil state
CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready
CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.On
CurrentHostState : xyz.openbmc_project.State.Host.HostState.Running
BootProgress : xyz.openbmc_project.State.Boot.Progress.
ProgressStages.OSRunning
OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.
OSStatus.Inactive
-Check CollectionStatus property of vpd-manager D-Bus service:
root@p10bmc:~# busctl get-property com.ibm.VPD.Manager /com/ibm/VPD/
Manager com.ibm.VPD.Manager CollectionStatus
s "Completed"
- Check execution time change
Measure the time between vpd-manager event loop start and
CollectionStatus = Completed on a Everest system. Following figures were
measured across 3 reboots:
- On current code, (with the extra async call) it is 61 secs.
- With the changes in this PR, it is 60.33 secs.
```
Change-Id: I86dd9f9f6a4c67b8159e4c90d6ffdb005568cf6b
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/include/manager.hpp b/vpd-manager/include/manager.hpp
index cb64123..73d82c2 100644
--- a/vpd-manager/include/manager.hpp
+++ b/vpd-manager/include/manager.hpp
@@ -255,6 +255,11 @@
* @param[in] i_msg - The callback message.
*/
void processAssetTagChangeCallback(sdbusplus::message_t& i_msg);
+
+ /**
+ * @brief API to process VPD collection thread failed EEPROMs.
+ */
+ void processFailedEeproms();
#endif
/**