Skip to content

Commit 70d4fbc

Browse files
authored
Fix introspection ready wait on session open (#652)
After the first OpenSession, the service telemetry thread probes providers and RegisterDevicesToIpc before signaling introspection-ready. Middleware waited only 1500 ms on that event during MakeMiddlewareComms, which could expire under load. Use a 5000 ms constant for MiddlewareComms waits.
1 parent 0767d2a commit 70d4fbc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

IntelPresentMon/Interprocess/source/Interprocess.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ namespace pmon::ipc
5050
}
5151
}
5252

53+
static constexpr uint32_t kMiddlewareIntrospectionReadyTimeoutMs = 5000;
54+
5355
class CommsBase_
5456
{
5557
protected:
@@ -318,7 +320,7 @@ namespace pmon::ipc
318320
introReadyEvent_{ util::win::Event::OpenNamed(namer_.MakeIntrospectionReadyName(), SYNCHRONIZE) },
319321
shm_{ bip::open_read_only, namer_.MakeIntrospectionName().c_str() }
320322
{
321-
WaitOnIntrospectionReadyEvent_(introReadyEvent_, 1500);
323+
WaitOnIntrospectionReadyEvent_(introReadyEvent_, kMiddlewareIntrospectionReadyTimeoutMs);
322324
systemShm_.emplace(namer_.MakeSystemName());
323325
// Eager-load all GPU segments based on introspection
324326
auto ids = GetGpuDeviceIds_();
@@ -409,7 +411,7 @@ namespace pmon::ipc
409411
std::vector<uint32_t> GetGpuDeviceIds_()
410412
{
411413
// make sure the immutable snapshot has been published
412-
WaitOnIntrospectionReadyEvent_(introReadyEvent_, 1500);
414+
WaitOnIntrospectionReadyEvent_(introReadyEvent_, kMiddlewareIntrospectionReadyTimeoutMs);
413415
// find the introspection structure in shared memory
414416
const auto result = shm_.find<intro::IntrospectionRoot>(introspectionRootName_);
415417
if (!result.first) {

0 commit comments

Comments
 (0)