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

    https://github.com/apache/spark/pull/7927#discussion_r36297953
  
    --- Diff: 
core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala ---
    @@ -443,6 +448,34 @@ class BlockManagerSuite extends SparkFunSuite with 
Matchers with BeforeAndAfterE
         assert(list2DiskGet.get.readMethod === DataReadMethod.Disk)
       }
     
    +  test("(SPARK-9591)getRemoteBytes from another location when  IOException 
throw") {
    +    try {
    +      conf.set("spark.network.timeout", "2s")
    +      store = makeBlockManager(8000, "executor1")
    +      store2 = makeBlockManager(8000, "executor2")
    +      store3 = makeBlockManager(8000, "executor3")
    +      val list1 = List(new Array[Byte](4000))
    +      store2.putIterator("list1", list1.iterator, 
StorageLevel.MEMORY_ONLY, tellMaster = true)
    +      store3.putIterator("list1", list1.iterator, 
StorageLevel.MEMORY_ONLY, tellMaster = true)
    +      var list1Get = store.getRemoteBytes("list1")
    +      assert(list1Get.isDefined, "list1Get expected to be fetched")
    +      // block manager exit
    +      store2.stop()
    +      store2 = null
    +      list1Get = store.getRemoteBytes("list1")
    +      // get `list1` block
    +      assert(list1Get.isDefined, "list1Get expected to be fetched")
    +      store3.stop()
    +      store3 = null
    +      // exception throw because there is no locations
    +      intercept[java.io.IOException] {
    +        list1Get = store.getRemoteBytes("list1")
    +      }
    +    } finally {
    +      conf.remove("spark.network.timeout")
    --- End diff --
    
    just in case somebody changes this test suite to use a specific network 
timeout, I think you should restore to the previous value, if there was one.
    
    ```scala
    val origTimeoutOpt = conf.getOption("spark.network.timeout")
    try {
     ...
    } finally {
      origTimeoutOpt match {
        case Some(t) => conf.set("spark.network.timeout", t)
        case None => conf.remove("spark.network.timeout")
      }
    }
    ```


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