Skip to content

Commit 3f4d48d

Browse files
committed
Added in the check that the monitor is stopped so that the adding processes code is identical to the * option
1 parent f8f5a00 commit 3f4d48d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

cls/TestCoverage/Manager.cls

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,22 @@ Method StartCoverageTracking() As %Status [ Private ]
253253
if ('$LISTFIND(tProcessIDs, $Job)) {
254254
set $LIST(tProcessIDs, *+1) = $Job
255255
}
256+
// Extra check to make sure that monitor is stopped (another chance to get problem processes to unmap from shared memory)
257+
// Sometimes the monitor does not stop right away if there are other processes that are being monitored.
258+
// The root cause of this is unknown and could use further investigation at some point.
259+
Set tMaxAttempts = 5
260+
For {
261+
Set tUnmappedAll = $zu(84,0,0)
262+
Hang 1
263+
If (tUnmappedAll) {
264+
Quit
265+
}
266+
If ($Increment(tUnmapCounter) > tMaxAttempts) {
267+
Set tMsg = $$$FormatText("Some process(es) still holding on to shared memory for line by line monitor after %1 attempts to release. See console log or cstat -p-1 for details.",tMaxAttempts)
268+
$$$ThrowStatus($$$ERROR($$$GeneralError,tMsg))
269+
}
270+
}
256271
}
257-
set ^IRIS.TEMPCG($i(^IRIS.TEMPCG)) = tProcessIDs
258272
Set tMetrics = $ListBuild("RtnLine") _ $Select(..Timing:$ListBuild("Time","TotalTime"),1:"")
259273
$$$ThrowOnError(..Monitor.StartWithScope(tRelevantTargets,tMetrics,tProcessIDs))
260274
}

0 commit comments

Comments
 (0)