Github user nezihyigitbasi commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11241#discussion_r53531237
  
    --- Diff: 
core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala ---
    @@ -1263,4 +1263,44 @@ class BlockManagerSuite extends SparkFunSuite with 
Matchers with BeforeAndAfterE
         assert(result.size === 10000)
         assert(result.data === Right(bytes))
       }
    +
    +  test("SPARK-13328: refresh block locations from the driver if max fetch 
failures are reached") {
    +    import scala.concurrent._
    +    import ExecutionContext.Implicits.global
    +
    +    conf.set("spark.shuffle.io.maxRetries", "1")
    +    conf.set("spark.shuffle.io.retryWait", "1s")
    +    conf.set("spark.block.failures.beforeLocationRefresh", "1")
    +    conf.set("spark.dynamicAllocation.enabled", "true")
    +
    +    store = makeBlockManager(8000, "executor1")
    +    store2 = makeBlockManager(8000, "executor2")
    +    store3 = makeBlockManager(8000, "executor3")
    +
    +    val item = 999L
    +    store2.putSingle("item", item, StorageLevel.MEMORY_ONLY, tellMaster = 
true)
    +    store3.putSingle("item", item, StorageLevel.MEMORY_ONLY, tellMaster = 
true)
    +
    +    assert(store.getRemoteBytes("item").isDefined, "block should be 
fetched properly")
    +
    +    store2.stop()
    +    store2 = null
    +
    +    store3.stop()
    +    store3 = null
    +
    +    val f = Future {
    +      assert(store.getRemoteBytes("item").isDefined, "block should be 
fetched properly")
    +    }
    +
    +    Thread.sleep(3000)
    --- End diff --
    
    I don't also like depending on timing, but couldn't really find a decent 
way to trigger this code path (a case where a previously failing block fetch 
succeeds after a refresh). Which component do you propose to mock?


---
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]

Reply via email to