Killing an unreachable resident task will do nothing, rather than
destroy the reservations.
Fixes #5207
Also-By: tharper@mesosphere.com
unterstein | |
jenkins | |
• jasongilanfarr | |
meichstedt |
Killing an unreachable resident task will do nothing, rather than
destroy the reservations.
Fixes #5207
Also-By: tharper@mesosphere.com
sbt test
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Build has FAILED
Link to build: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1529/
See console output for more information: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1529/console
Build has FAILED
Link to build: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1531/
See console output for more information: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1531/console
Build is green https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1530/ for more details.
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 Otherwise the comment should be adjusted to reflect the reasoning and behavior. |
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 |
Build is green https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1572/ for more details.
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.
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. |
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. |
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. |
Build is green https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1588/ for more details.
Build has FAILED
Link to build: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1590/
See console output for more information: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1590/console
Build has FAILED
Link to build: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1593/
See console output for more information: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1593/console
inline KillActionResolver logic to KillAction
src/main/scala/mesosphere/marathon/core/task/termination/impl/KillActionResolver.scala | ||
---|---|---|
10 ↗ | (On Diff #2074) | agreed, I'll move it |
Build is green https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1596/ for more details.
Build is green https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1600/ for more details.
taskMap.exists((id,task) => task.reservationWithVolumes.isDefined) ?