Commit fe2b44b
authored
Widen ActorTaskScheduler(ActorCell) ctor to protected internal (#8158)
The two virtual hooks OnBeforeTaskStarted / OnAfterTaskCompleted have
always been protected, clearly intended as extension points for
libraries that need to observe async message handler lifetimes. But the
ctor was internal, blocking any external subclass from actually hooking
them without reflection or runtime codegen.
Widening the ctor to protected internal finishes the extension point
that was already half-exposed. protected lets external libraries
subclass; the internal part preserves the existing new
ActorTaskScheduler(this) call site in ActorCell without requiring a
derived type there.
Motivation: Phobos (the Akka.NET observability plugin) needs to
subclass ActorTaskScheduler to keep akka.msg.recv spans open for the
full duration of ReceiveAsync / CommandAsync handlers. Today the span
closes at the first await yield point, hiding all post-await work from
traces. Customers running Phobos on both .NET and .NET Framework hit
this, and we need a cross-runtime fix — IgnoresAccessChecksTo works
only on CoreCLR, reflection can't synthesize a subclass with an
inaccessible base ctor, and runtime codegen is AOT-hostile. Widening
the ctor is the clean fix.
No behavior change. Pure access widening, no caller breaks.1 parent 01edcb1 commit fe2b44b
3 files changed
Lines changed: 18 additions & 3 deletions
File tree
- src/core
- Akka.API.Tests/verify
- Akka/Dispatch
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2724 | 2724 | | |
2725 | 2725 | | |
2726 | 2726 | | |
| 2727 | + | |
2727 | 2728 | | |
2728 | 2729 | | |
2729 | 2730 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2742 | 2742 | | |
2743 | 2743 | | |
2744 | 2744 | | |
| 2745 | + | |
2745 | 2746 | | |
2746 | 2747 | | |
2747 | 2748 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
41 | 54 | | |
42 | | - | |
43 | | - | |
| 55 | + | |
| 56 | + | |
44 | 57 | | |
45 | 58 | | |
46 | 59 | | |
| |||
0 commit comments