From 1a09d7b5e6bc652e9ea0e826b8f77d3e4cc3f4cd Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 13 Jun 2024 15:36:02 +0200 Subject: Skip open process handle caching if we don't have a session id (#94) * Don't try to cache process handle if we don't have a session id --- CHANGELOG.md | 1 + src/zenutil/openprocesscache.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38024fed0..d5cbfd5d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ - Improvement: Add batch fetch of cache values in the GetCacheValues request - Improvement: Use a smaller thread pool for network operations when doing oplog import to reduce risk of NIC/router failure - Improvement: Medium worker pool now uses a minimum of 2 threads (up from 1) +- Improvement: Don't try to cache process handles on Windows if we don't have a session id - ## 5.5.2 - Bugfix: Don't try to read bytes to validate a compact binary object that is empty diff --git a/src/zenutil/openprocesscache.cpp b/src/zenutil/openprocesscache.cpp index fb654bde2..256d5fb4a 100644 --- a/src/zenutil/openprocesscache.cpp +++ b/src/zenutil/openprocesscache.cpp @@ -56,6 +56,10 @@ OpenProcessCache::GetProcessHandle(Oid SessionId, int ProcessPid) { return nullptr; } + if (SessionId == Oid::Zero) + { + return nullptr; + } #if ZEN_PLATFORM_WINDOWS ZEN_ASSERT(ProcessPid != 0); { -- cgit v1.2.3