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

Typed: Un-nest supervision that overlaps #25269

Conversation

johanandren
Copy link
Member

Fixes #25128

Also snuck in logging of the used strategy on failure in the supervision logs.

@akka-ci akka-ci added the validating PR is currently being validated by Jenkins label Jun 25, 2018
).onFailure[RuntimeException](SupervisorStrategy.restartWithLimit(23, 10.seconds))
).onFailure[IllegalArgumentException](SupervisorStrategy.restart)
).onFailure[RuntimeException](SupervisorStrategy.restart)
}).onFailure[RuntimeException](SupervisorStrategy.stop)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"hadouken!"
pyramid_of_doom_js_-_google_search

// totally fine to keep it, just reminded me of the old pic... ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pyramid of supervision doom!

}

override def toString = s"restartWithLimit(${strategy.maxNrOfRetries}, ${strategy.withinTimeRange}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing closing )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice to strings in general though

@akka-ci akka-ci added tested PR that was successfully built and tested by Jenkins and removed validating PR is currently being validated by Jenkins labels Jun 25, 2018
@akka-ci
Copy link

akka-ci commented Jun 25, 2018

Test PASSed.

@akka-ci akka-ci added validating PR is currently being validated by Jenkins and removed tested PR that was successfully built and tested by Jenkins labels Jun 25, 2018
Copy link
Member

@patriknw patriknw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

behavior match {
case s: Supervisor[T, _] ⇒
val inner = loop(s.behavior)
if (seenSupervised.contains(s.throwableClass))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could discard subclasses also but makes it a bit more complicated and the main purpose is to remove the accidental wrapping of same

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about that, but wasn't sure it is worth because it isn't very realistic that you add more general and more general supervision over time.

inner
else {
seenSupervised += s.throwableClass
if (inner.eq(s.behavior)) s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operator style of eq

}

override def toString = s"restartWithBackoff(${strategy.minBackoff}, ${strategy.maxBackoff}, ${strategy.randomFactor})"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty duration?

@akka-ci akka-ci added validating PR is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed validating PR is currently being validated by Jenkins labels Jun 25, 2018
@akka-ci
Copy link

akka-ci commented Jun 25, 2018

Test PASSed.

@akka-ci akka-ci added the tested PR that was successfully built and tested by Jenkins label Jun 25, 2018
@akka-ci
Copy link

akka-ci commented Jun 25, 2018

Test PASSed.

Copy link
Member

@chbatey chbatey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akka-ci akka-ci added validating PR is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed tested PR that was successfully built and tested by Jenkins validating PR is currently being validated by Jenkins labels Jun 25, 2018
@akka-ci
Copy link

akka-ci commented Jun 25, 2018

Test PASSed.

@johanandren johanandren merged commit 2b6997b into akka:master Jun 25, 2018
@johanandren johanandren deleted the wip-25128-nested-supervision-akka-typed-johanandren branch June 25, 2018 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tested PR that was successfully built and tested by Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants