Skip to content
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

Behaviors.supervise cause java.lang.StackOverflowError #25128

Closed
shejnowicz opened this issue May 22, 2018 · 3 comments
Closed

Behaviors.supervise cause java.lang.StackOverflowError #25128

shejnowicz opened this issue May 22, 2018 · 3 comments
Assignees
Labels
3 - in progress Someone is working on this ticket bug t:typed
Milestone

Comments

@shejnowicz
Copy link

shejnowicz commented May 22, 2018

If we create behaviour recursively with supervising then it will blow with java.lang.StackOverflowError
after some time. Similar issue I observed in akka 2.5.11 for Behaviors.withMdc (seems to be fixed in 2.5.12)

(pseudocode)

def errorCauseBehaviour(state: Int) =
    Behaviors.supervise[SomeMessageType] {
        Behaviors.receive { (ctx, msg) =>
           msg match {
              case _ => errorCauseBehaviour(state + 1)
           }
        }
    } onFailure resume
@ktoso ktoso added 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted bug t:typed labels May 23, 2018
@ktoso
Copy link
Member

ktoso commented May 23, 2018

Thanks for reporting

@chbatey
Copy link
Member

chbatey commented May 25, 2018

@shejnowicz you should only supervise once so just supervise the initial creation.
However we should defect this and fail fast or unwrap it

@chbatey
Copy link
Member

chbatey commented Jun 4, 2018

Made a note in the docs: #25163

@johanandren johanandren self-assigned this Jun 5, 2018
@johanandren johanandren added 3 - in progress Someone is working on this ticket and removed 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted labels Jun 5, 2018
johanandren added a commit to johanandren/akka that referenced this issue Jun 25, 2018
@johanandren johanandren added this to the 2.5.14 milestone Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - in progress Someone is working on this ticket bug t:typed
Projects
None yet
Development

No branches or pull requests

4 participants