commit | 6136e852e4eadf9d3e83b58be17f393a96ea2f64 | [log] [tgz] |
---|---|---|
author | Myung Bae <myungbae@us.ibm.com> | Wed May 14 07:53:45 2025 -0400 |
committer | Myung Bae <myungbae@us.ibm.com> | Thu May 15 15:19:01 2025 -0500 |
tree | a73f28f08c2388596eae71ef8829f377b242e5a3 | |
parent | 0c814aa604b36cff01b495f9c335f981c7be83be [diff] |
Fix inconsistent persistent subscription load When BMC reboots or bmcweb restarts, the persistent subscriptions may not be loaded properly but they may still be in the file. Later on if BMC reboots or bmcweb restarts, those unloaded subscriptions may potentially and unexpectedly cause the reload into the active subscriptions. The key cause is due to the compiler evaluation order for the function arguments where the last argument is evaluated and pushed into the stack first. As the result, the first argument `newSub->id` may already be invalid after the last argument `std::make_shared<>(std::move(*newSub))` is evaluated and pushed into the parameter stack [1]. This may cause the failure of `subscriptionsConfigMap.emplace()` and results in the missing instantiation of the persistent subscriptions. Tested: - Create many subscriptions - GET subscriptions ``` curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions { "@odata.id": "/redfish/v1/EventService/Subscriptions", "@odata.type": "#EventDestinationCollection.EventDestinationCollection", "Members": [ { "@odata.id": "/redfish/v1/EventService/Subscriptions/1187258741" }, ... { "@odata.id": "/redfish/v1/EventService/Subscriptions/949306789" } ], "Members@odata.count": 6, "Name": "Event Destination Collections" } ``` - Restart bmcweb - GET subscriptions again and check whether they are the same. - Sometimes, none or only a few may be instantiated like ``` curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions { "@odata.id": "/redfish/v1/EventService/Subscriptions", "@odata.type": "#EventDestinationCollection.EventDestinationCollection", "Members": [ { "@odata.id": "/redfish/v1/EventService/Subscriptions/1187258741" } ], "Members@odata.count": 1, "Name": "Event Destination Collections" } ``` - However, the file `/home/root/bmcweb_persistent_data.json` still has the old entries. - Also verify Redfish Service Validator to pass [1] https://github.com/openbmc/bmcweb/blob/0c814aa604b36cff01b495f9c335f981c7be83be/include/persistent_data.hpp#L184 Change-Id: Ia8a3c1bd3d4f4e479b599077ba8f26e47f8d22ef Signed-off-by: Myung Bae <myungbae@us.ibm.com>
This component attempts to be a "do everything" embedded webserver for OpenBMC.
The webserver implements a few distinct interfaces:
bmcweb at a protocol level supports http and https. TLS is supported through OpenSSL.
Bmcweb supports multiple authentication protocols:
Each of these types of authentication is able to be enabled or disabled both via runtime policy changes (through the relevant Redfish APIs) or via configure time options. All authentication mechanisms supporting username/password are routed to libpam, to allow for customization in authentication implementations.
All authorization in bmcweb is determined at routing time, and per route, and conform to the Redfish PrivilegeRegistry.
*Note: Non-Redfish functions are mapped to the closest equivalent Redfish privilege level.
bmcweb is configured per the meson build files. Available options are documented in meson_options.txt
meson setup builddir ninja -C builddir
If any of the dependencies are not found on the host system during configuration, meson will automatically download them via its wrap dependencies mentioned in bmcweb/subprojects
.
bmcweb relies on some on-system data for storage of persistent data that is internal to the process. Details on the exact data stored and when it is read/written can seen from the persistent_data
namespace.
When SSL support is enabled and a usable certificate is not found, bmcweb will generate a self-signed a certificate before launching the server. Please see the bmcweb source code for details on the parameters this certificate is built with.
bmcweb is capable of aggregating resources from satellite BMCs. Refer to AGGREGATION.md for more information on how to enable and use this feature.