-
Notifications
You must be signed in to change notification settings - Fork 157
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: resolves and addition tests for child preStart supervise #1385
fix: resolves and addition tests for child preStart supervise #1385
Conversation
From the perspective of stack frame, the problem lies in the handling: pekko/actor/src/main/scala/org/apache/pekko/actor/dungeon/FaultHandling.scala Lines 158 to 163 in 46c5574
|
@@ -643,7 +643,7 @@ private[pekko] class ActorCell( | |||
def failActor(): Unit = | |||
if (_actor != null) { | |||
clearActorFields(actor, recreate = false) | |||
setFailedFatally() | |||
setFailed(actor.self) |
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 am not sure if this change will break other cases or not, I will investigate later.
relate PR:
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.
After investigation, we can not set the fault state here... otherwise, we can not distinguish between fatal and normal fault
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.
(these links to Akka PRs are OK because they're old, pre-BSL PRs :) )
I think we can attach a test case for this, will look into this over the weekend. |
@sadekmunawar Hi, my unit test partly refers to your code in #1383 links. Would you like to contribute this to the Pekko community? |
@pjfanning Am I doing this correctly, may I ask? |
The test code was written by https://discuss.lightbend.com/u/nodeninja/summary @sadekmunawar can you confirm if that is you? We received your iCLA. |
@pjfanning yes, that's me. After finding the bug, I wrote that test for a solution I implemented. My solution converts the I also wrote a scala version of this test in
|
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.
lgtm
lgtm. |
@@ -160,6 +160,33 @@ class ActorLifeCycleSpec extends PekkoSpec with BeforeAndAfterEach with Implicit | |||
a ! "hello" | |||
expectMsg(42) | |||
} | |||
|
|||
"not break supervisor strategy due to unhandled exception in preStart" in { |
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.
Contributed by @sadekmunawar
Thanks, I have updated this PR and verified it works in locally |
@Roiocam should we backport this to this 1.0.x branch? |
…#1385) * chore: add unit test for child actor initial exception supervise * make assertion correct * trying to fix assertion failed * distinguish between fatal and normal fault * fix unit tests * trying to fix * fix NPE * revert isFailed condition * revert isFailed place * additional tests
…#1396) * chore: add unit test for child actor initial exception supervise * make assertion correct * trying to fix assertion failed * distinguish between fatal and normal fault * fix unit tests * trying to fix * fix NPE * revert isFailed condition * revert isFailed place * additional tests
It looks like the checks did not run the tests in When I ran the tests locally, two tests in
Can someone check if these two unit tests pass? |
Those tests are tagged as long-running tests. Maybe such tests are not run by default. Did those tests fail before this PR was added? |
No, they passed in my local workspace before this PR was added. Unless there's something wrong with my local setup, this PR is the likely cause of the failures. I ran into issues with these two unit tests when experimenting with my own fix. |
I will investigate it. :) |
both |
Related with #1384 and resolves #1384, some of code contributed by @sadekmunawar
if PR can reproducer this issue, the ci checks will be unable to successd: https://github.com/apache/pekko/actions/runs/9770536752/job/26971887726?pr=1385