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

    https://github.com/apache/spark/pull/7927#discussion_r36204820
  
    --- Diff: 
core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala ---
    @@ -443,6 +443,21 @@ class BlockManagerSuite extends SparkFunSuite with 
Matchers with BeforeAndAfterE
         assert(list2DiskGet.get.readMethod === DataReadMethod.Disk)
       }
     
    +  test("block manager crash test") {
    +    conf.set("spark.network.timeout", "5s")
    +    store = makeBlockManager(8000)
    +    store2 = makeBlockManager(8000)
    +    val list1 = List(new Array[Byte](4000))
    +    store2.putIterator("list1", list1.iterator, StorageLevel.MEMORY_ONLY, 
tellMaster = true)
    +    val list1Get = store.getRemote("list1")
    +    assert(list1Get.isDefined, "list1get expected to be fetched")
    +    // simulate block manager crashed
    +    store2.stop()
    +    val list1GetAgain = store.getRemoteBytes("list1")
    +    assert(!list1GetAgain.isDefined, "list1getagain expected to be not 
fetched")
    --- End diff --
    
    I don't think you are testing the right thing here at all ... I think in 
this case, we still want to throw an exception (as I commented above), 
otherwise there is a big behavior change.
    
    I thought the behavior that you want is, If you store the block in 
*multiple* locations, but then you lose one of them, `getRemoteBytes` shouldn't 
fail -- it should keep trying till it finds a valid location.
    
    To make your test take multiple "peered" block managers into account, you 
need to pass a second arg to `makeBlockManager`, to give them each a unique id, 
like is done in the ["master + 2 managers interaction" 
test](https://github.com/apache/spark/blob/d702d53732b44e8242448ce5302738bd130717d8/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala#L180)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to