-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cycle detector issue with checking for blocked actors #3154
Conversation
As part of PR ponylang#2800, I broke the cycle detector due to incorrect incremental logic for querying actors for if they're blocked. I relied on the hashmap internal array/bucket index value instead of keeping tracking of # of actors queried for if they're blocked during the current function call. This commit resolves the logic issue described above by keeping a running count of actors queried during the current function call. This commit also implements @plprofetes suggestion to make the threshold for # of actors to query for if they're blocked into a dynamic value. Specifically, the threshold is now the larger of the `CD_MAX_CHECK_BLOCKED` constant (which is 1000) or 10% of the total number of actors currently known to exist by the cycle detector. Resolves ponylang#2975.
This was tested using @plprofetes' example program in #2975. The change regarding the dynamic threshold for # of actors to query if they're blocked is somewhat controversial as it can result in message storms originating from the cycle detector. Let me know if that change should be reverted or separated out into its own PR. |
f95c7e9
to
3a757ae
Compare
Just wondering, does the name |
Possibly. Got any ideas for a better name? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep coming up with bad naming ideas involving the "minimum maximum", so maybe not. To avoid confusion for future readers, I'm just suggesting we add this comment to make sure the reader knows how the constant is intended to be used, so that they can tell it is working as intended, and not see it as a bug that we may have a limit that is larger than the "maximum".
Co-Authored-By: Joe Eli McIlvain <joe.eli.mac@gmail.com>
@dipinhora can you add release notes for this? |
release notes (possibly):
|
As part of PR #2800, I broke the cycle detector due to incorrect
incremental logic for querying actors for if they're blocked. I
relied on the hashmap internal array/bucket index value instead
of keeping tracking of # of actors queried for if they're blocked
during the current function call.
This commit resolves the logic issue described above by keeping
a running count of actors queried during the current function
call.
This commit also implements @plprofetes suggestion to make the
threshold for # of actors to query for if they're blocked into
a dynamic value. Specifically, the threshold is now the larger
of the
CD_MAX_CHECK_BLOCKED
constant (which is 1000) or 10%of the total number of actors currently known to exist by the
cycle detector.
Resolves #2975.