perf(runtime): split trigger evals from the blocking pool; bounded, deadline-aware execution
This commit is contained in:
@@ -1028,14 +1028,22 @@ public class AlarmActorTests : TestKit, IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExpressionAlarm_EvaluatesOnSchedulerThread_AndActivates()
|
||||
public void ExpressionAlarm_EvaluatesOffTheBlockingScriptPool_AndActivates()
|
||||
{
|
||||
// TRUE only when evaluated on a script-execution thread. Before P1 the
|
||||
// expression ran on the actor dispatcher (name is NOT "script-execution-*")
|
||||
// → false → alarm never activates. After P1 it runs on the script scheduler.
|
||||
// WP3.1 retarget of the former P1 assertion, whose sense is deliberately INVERTED.
|
||||
//
|
||||
// P1 moved the evaluation off the actor's dispatcher and onto the dedicated
|
||||
// script-execution scheduler, and this test asserted exactly that. WP3.1 (finding #4)
|
||||
// proved that destination wrong for alarms in particular: sharing the blocking pool
|
||||
// meant an alarm that should raise in milliseconds queued behind blocked script bodies
|
||||
// for an unbounded time, and its 2 s evaluation timeout did not even start ticking
|
||||
// until it was dequeued. Evaluations now run on the shared .NET thread pool behind
|
||||
// TriggerEvalGate.
|
||||
//
|
||||
// TRUE only when evaluated OFF a script-execution thread.
|
||||
var expr = CompileRawTriggerExpression(
|
||||
"System.Threading.Thread.CurrentThread.Name != null && " +
|
||||
"System.Threading.Thread.CurrentThread.Name.StartsWith(\"script-execution-\")");
|
||||
"System.Threading.Thread.CurrentThread.Name == null || " +
|
||||
"!System.Threading.Thread.CurrentThread.Name.StartsWith(\"script-execution-\")");
|
||||
var alarmConfig = new ResolvedAlarm
|
||||
{
|
||||
CanonicalName = "ExprAlarm",
|
||||
|
||||
Reference in New Issue
Block a user