Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/16650#discussion_r99596922
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/BlacklistTrackerSuite.scala ---
@@ -456,4 +461,69 @@ class BlacklistTrackerSuite extends SparkFunSuite with
BeforeAndAfterEach with M
conf.remove(config)
}
}
+
+ test("blacklisting kills executors, configured by
BLACKLIST_KILL_ENABLED") {
+ val allocationClientMock = mock[ExecutorAllocationClient]
+ when(allocationClientMock.killExecutors(any(), any(),
any())).thenReturn(Seq("called"))
+ when(allocationClientMock.killExecutorsOnHost("hostA")).thenAnswer(new
Answer[Boolean] {
+ override def answer(invocation: InvocationOnMock): Boolean = {
+ if (blacklist.nodeBlacklist.contains("hostA") == false) {
+ throw new IllegalStateException("hostA should be on the
blacklist")
--- End diff --
Worth adding a comment here explaining what the point of this check is
To avoid a race between blacklisting and killing, its important that the
nodeBlacklist is updated *before* we ask the executor allocation client to kill
executors on the host.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]