HomeMesosphereNo notifications. 4 unresolved issues.

Don't destroy persistent volumes when killing unreachable resident tasks
ClosedAll Users

Authored by timcharper on Feb 20 2017, 4:04 PM.

Diff Detail

Repository
rMARATHON marathon
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
There are a very large number of changes, so older changes are hidden. Show Older Changes

update description

timcharper updated this revision to Diff 2039.Feb 28 2017, 2:07 AM

revert missing changes

jenkins requested changes to this revision.Feb 28 2017, 2:08 AM
This revision now requires changes to proceed.Feb 28 2017, 2:08 AM
jenkins accepted this revision.Feb 28 2017, 2:36 AM

LGTM

timcharper marked an inline comment as done.Feb 28 2017, 5:14 PM
meichstedt accepted this revision.Mar 1 2017, 7:04 PM

One minor comment, otherwise LGTM

src/main/scala/mesosphere/marathon/core/task/termination/impl/KillActionResolver.scala
52 ↗(On Diff #2039)

Thinking out loud: should we differentiate between these two cases? The comment above says

// An instance will be expunged once all tasks are terminal. Therefore, this case is
// highly unlikely. Should it ever occur, this will still expunge the instance to clean up.

isUnkillable -> Noop
allTerminal -> expunge
?

Otherwise the comment should be adjusted to reflect the reasoning and behavior.

This revision is now accepted and ready to land.Mar 1 2017, 7:04 PM
timcharper updated this revision to Diff 2074.Mar 1 2017, 9:21 PM

update comment

jenkins requested changes to this revision.Mar 1 2017, 9:21 PM
This revision now requires changes to proceed.Mar 1 2017, 9:21 PM
timcharper marked an inline comment as done.Mar 1 2017, 9:22 PM
timcharper added inline comments.
src/main/scala/mesosphere/marathon/core/task/termination/impl/KillActionResolver.scala
52 ↗(On Diff #2039)

good catch.

I think the behavior is correct (accounting for the decision to not support kill-while-unreachable for resident tasks). I've update the comment

jenkins accepted this revision.Mar 1 2017, 9:39 PM

Thanks.

This revision is now accepted and ready to land.Mar 1 2017, 9:39 PM

Mostly minor/stylistic stuff

src/main/scala/mesosphere/marathon/core/task/termination/KillReason.scala
40 ↗(On Diff #2074)

By the user? (If so, please document)

src/main/scala/mesosphere/marathon/core/task/termination/impl/KillActionResolver.scala
10 ↗(On Diff #2074)

Could be in KillAction's companion via an apply()

src/main/scala/mesosphere/marathon/core/task/termination/impl/KillServiceActor.scala
142

may be better as Done () looks weird.

src/main/scala/mesosphere/marathon/core/task/termination/impl/ToKill.scala
18 ↗(On Diff #2074)

Does this need to stand alone?

minor changes requested still approved.

  • sbt doc will fail because there's an invalid ref (see comment)
  • there's an unused import due to double package notation. I'll try to change my scala file template to add double package notation for mesosphere.marathon by default.
src/main/scala/mesosphere/marathon/core/task/termination/KillReason.scala
40 ↗(On Diff #2074)

The need for this vale has been removed, please delete it.

src/main/scala/mesosphere/marathon/core/task/termination/impl/KillAction.scala
30

The mentioned value does not exist anymore. Please delete the note.

src/main/scala/mesosphere/marathon/core/task/termination/impl/KillActionResolver.scala
10 ↗(On Diff #2074)

It's a question of preference and I'm not sure about which preference we share within the team. I am not a big fan of files containing more than one definition, especially when it mixes up contracts and logic. The combination of both, for me personally, is visual clutter. If we apply this approach generally, everything in termination.* will end up in the same file basically. In my opinion, packages act as a better container for classes, objects, and types.

src/main/scala/mesosphere/marathon/core/task/termination/impl/KillServiceActor.scala
142

agreed.

src/main/scala/mesosphere/marathon/core/task/termination/impl/ToKill.scala
4 ↗(On Diff #2074)

unused import

18 ↗(On Diff #2074)

I've extracted the class because it's now used in KillServiceActor and KillActionResolver. I don't feel too strong about this, but if we move this, we can move everything into 1 file. Not sure that's better.

I understand though that in one case class per file seems picky.

timcharper marked 12 inline comments as done.Mar 2 2017, 4:36 PM
timcharper added inline comments.
src/main/scala/mesosphere/marathon/core/task/termination/KillReason.scala
40 ↗(On Diff #2074)

Great catch.

src/main/scala/mesosphere/marathon/core/task/termination/impl/KillActionResolver.scala
10 ↗(On Diff #2074)

I'm inclined to agree with Matthias; if KillAction were only used by one class, then putting it in the companion object is optimal. However, it's used by KillActionResolved, and, putting KillActionResolver logic in the actor starts to make the file rather big, pushing it past the 500 line count. ¯\_(ツ)_/¯

src/main/scala/mesosphere/marathon/core/task/termination/impl/KillServiceActor.scala
142

gonna push back slightly. It seems that () isn't inherently weird... it's an empty tuple. Unit.

Future[Done] is much better than Future[Unit] because of the pitfalls for accidentally tossing an enclosed Future[Unit]. However, in the case of Unit, our linter is too aggressive and will expect that the caller assign it.

src/main/scala/mesosphere/marathon/core/task/termination/impl/ToKill.scala
18 ↗(On Diff #2074)

No.

jasongilanfarr requested changes to this revision.Mar 2 2017, 4:40 PM
jasongilanfarr added inline comments.
src/main/scala/mesosphere/marathon/core/task/termination/impl/KillActionResolver.scala
10 ↗(On Diff #2074)

If this was about the other class that stood alone, I'd agree, but it's not. This is "how do I get a KillAction" which KillAction _should_ do/be responsible for. I'm not saying it should be in the actor.

This revision now requires changes to proceed.Mar 2 2017, 4:40 PM
timcharper updated this revision to Diff 2085.Mar 2 2017, 4:40 PM
timcharper marked 2 inline comments as done.

address comments

jenkins requested changes to this revision.Mar 2 2017, 4:40 PM
This revision now requires changes to proceed.Mar 2 2017, 4:40 PM
timcharper updated this revision to Diff 2087.Mar 2 2017, 4:48 PM

use inside; wrap long lines

jenkins requested changes to this revision.Mar 2 2017, 4:57 PM
This revision now requires changes to proceed.Mar 2 2017, 4:57 PM
jenkins accepted this revision.Mar 2 2017, 4:59 PM

Ship it!

timcharper updated this revision to Diff 2088.Mar 2 2017, 5:13 PM

mark ActorOfferMatcherTest unstable

jenkins requested changes to this revision.Mar 2 2017, 5:13 PM
This revision now requires changes to proceed.Mar 2 2017, 5:13 PM
timcharper updated this revision to Diff 2091.Mar 2 2017, 5:35 PM

inline KillActionResolver logic to KillAction

  • remove usage of ToKill outside of actor
  • inline ToKill with actor companion object
timcharper marked an inline comment as done.Mar 2 2017, 5:35 PM
timcharper added inline comments.
src/main/scala/mesosphere/marathon/core/task/termination/impl/KillActionResolver.scala
10 ↗(On Diff #2074)

agreed, I'll move it

jenkins requested changes to this revision.Mar 2 2017, 5:35 PM
This revision now requires changes to proceed.Mar 2 2017, 5:35 PM
jenkins accepted this revision.Mar 2 2017, 5:53 PM

LGTM

jasongilanfarr added inline comments.
src/main/scala/mesosphere/marathon/core/task/termination/impl/KillAction.scala
64

minor, but apply() seems useful.

src/test/scala/mesosphere/marathon/core/task/termination/impl/KillActionTest.scala
32–40

Remove the formatting pretty please.

This revision is now accepted and ready to land.Mar 2 2017, 11:26 PM
timcharper updated this revision to Diff 2097.Mar 3 2017, 1:53 AM

rebase. make Jason happy.

jenkins requested changes to this revision.Mar 3 2017, 1:58 AM
This revision now requires changes to proceed.Mar 3 2017, 1:58 AM
jenkins accepted this revision.Mar 3 2017, 2:23 AM

(ノ◕ヮ◕)ノ*: It's Green :*ヽ(◕ヮ◕ヽ)

This revision is now accepted and ready to land.Mar 3 2017, 2:23 AM
This revision was automatically updated to reflect the committed changes.