-
-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure scheduler threads don't ACK the quiescence protocol CNF mes…
…sages if they have an actor waiting to be run (#4583)
- Loading branch information
Showing
4 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Make sure scheduler threads don't ACK the quiescence protocol CNF messages if they have an actor waiting to be run | ||
|
||
Prior to this, the pinned actor thread could cause early termination/quiescence of a pony program if there were only pinned actors active. This change fixes the issue to ensure that pony programs with only pinned actors active will no longer terminate too early. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use @pony_exitcode[None](code: I32) | ||
use @usleep[I32](micros: U32) if not windows | ||
use @Sleep[None](millis: U32) if windows | ||
use "actor_pinning" | ||
|
||
actor Main | ||
let _env: Env | ||
let _auth: PinUnpinActorAuth | ||
|
||
new create(env: Env) => | ||
_env = env | ||
_auth = PinUnpinActorAuth(env.root) | ||
ActorPinning.request_pin(_auth) | ||
check_pinned() | ||
|
||
be check_pinned() => | ||
if ActorPinning.is_successfully_pinned(_auth) then | ||
do_stuff(100) | ||
else | ||
check_pinned() | ||
end | ||
|
||
be do_stuff(i: I32) => | ||
// sleep for a while so that the quiescence CNF/ACK protocol can happen | ||
ifdef windows then | ||
@Sleep(10) | ||
else | ||
@usleep(10000) | ||
end | ||
if i < 0 then | ||
// set the exit code if this behavior has been run enough times | ||
// issue 4582 identified early quiescence/termination if only pinned | ||
// actors remained active | ||
@pony_exitcode(100) | ||
else | ||
do_stuff(i - 1) | ||
end | ||
|
||
be done() => | ||
ActorPinning.request_unpin(_auth) |