File tree Expand file tree Collapse file tree 4 files changed +53
-8
lines changed Expand file tree Collapse file tree 4 files changed +53
-8
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,12 @@ class Manager
255255 * @param[in] i_msg - The callback message.
256256 */
257257 void processAssetTagChangeCallback (sdbusplus::message_t & i_msg);
258+
259+ /* *
260+ * @brief API to process list of EEPROMs for which VPD collection thread
261+ * creation has failed.
262+ */
263+ void ProcessFailedEeproms ();
258264#endif
259265
260266 /* *
Original file line number Diff line number Diff line change @@ -147,6 +147,22 @@ class Worker
147147 return m_activeCollectionThreadCount;
148148 }
149149
150+ /* *
151+ * @brief API to get the list of EEPROMs for which VPD collection thread
152+ * creation has failed.
153+ *
154+ * This API returns the list of EEPROMs for which VPD collection thread
155+ * creation has failed by reference. Manager needs to process this list of
156+ * EEPROMs and take appropriate action.
157+ *
158+ * @return reference to list of EEPROM paths for which VPD collection thread
159+ * creation has failed
160+ */
161+ std::forward_list<std::string>& getListOfEepromPathsThreadFailed () noexcept
162+ {
163+ return m_failedEepromPaths;
164+ }
165+
150166 private:
151167 /* *
152168 * @brief An API to parse and publish a FRU VPD over D-Bus.
@@ -526,5 +542,8 @@ class Worker
526542 // Counting semaphore to limit the number of threads.
527543 std::counting_semaphore<constants::MAX_THREADS> m_semaphore{
528544 constants::MAX_THREADS};
545+
546+ // List of EEPROM paths for which VPD collection thread creation has failed.
547+ std::forward_list<std::string> m_failedEepromPaths;
529548};
530549} // namespace vpd
Original file line number Diff line number Diff line change @@ -236,6 +236,8 @@ void Manager::SetTimerToDetectSVPDOnDbus()
236236 m_interface->set_property (" CollectionStatus" ,
237237 std::string (" InProgress" ));
238238 m_worker->collectFrusFromJson ();
239+
240+ ProcessFailedEeproms ();
239241 }
240242 });
241243}
@@ -910,4 +912,17 @@ void Manager::performVpdRecollection()
910912 std::string (l_ex.what ()));
911913 }
912914}
915+
916+ void Manager::ProcessFailedEeproms ()
917+ {
918+ if (m_worker.get () != nullptr )
919+ {
920+ // TODO:
921+ // - iterate through list of EEPROMs for which thread creation has
922+ // failed
923+ // - get list of FRUs under the EEPROM
924+ // - For each FRU, extract the object path and do collect single FRU
925+ m_worker->getListOfEepromPathsThreadFailed ().clear ();
926+ }
927+ }
913928} // namespace vpd
Original file line number Diff line number Diff line change @@ -1514,21 +1514,26 @@ void Worker::collectFrusFromJson()
15141514 m_activeCollectionThreadCount--;
15151515 m_mutex.unlock ();
15161516
1517- if (!m_activeCollectionThreadCount)
1517+ if (!m_activeCollectionThreadCount &&
1518+ m_failedEepromPaths.empty ())
15181519 {
15191520 m_isAllFruCollected = true ;
15201521 }
15211522 }}.detach ();
15221523 }
15231524 catch (const std::exception& l_ex)
15241525 {
1525- // TODO: Should we re-try launching thread for this FRU?
1526- EventLogger::createSyncPel (
1527- types::ErrorType::InvalidVpdMessage, types::SeverityType::Alert,
1528- __FILE__, __FUNCTION__, 0 ,
1529- std::string (" Failed to start collection thread for FRU :[" +
1530- vpdFilePath + " ]. Error: " + l_ex.what ()),
1531- std::nullopt , std::nullopt , std::nullopt , std::nullopt );
1526+ try
1527+ {
1528+ // add vpdFilePath(EEPROM path) to failed list
1529+ m_failedEepromPaths.push_front (vpdFilePath);
1530+ }
1531+ catch (const std::exception& l_ex)
1532+ {
1533+ logging::logMessage (
1534+ " Failed to add [" + vpdFilePath +
1535+ " ] to failed EEPROM list. Error: " + l_ex.what ());
1536+ }
15321537 }
15331538 }
15341539}
You can’t perform that action at this time.
0 commit comments