attilapiros commented on code in PR #45228:
URL: https://github.com/apache/spark/pull/45228#discussion_r1543240507


##########
core/src/main/scala/org/apache/spark/storage/FallbackStorage.scala:
##########
@@ -110,14 +158,35 @@ private[spark] object FallbackStorage extends Logging {
   /** We use one block manager id as a place holder. */
   val FALLBACK_BLOCK_MANAGER_ID: BlockManagerId = BlockManagerId("fallback", 
"remote", 7337)
 
-  def getFallbackStorage(conf: SparkConf): Option[FallbackStorage] = {
-    if (conf.get(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH).isDefined) {
-      Some(new FallbackStorage(conf))
+  // There should be only one fallback storage thread pool per executor.
+  var fallbackStorage: Option[FallbackStorage] = None
+  def getFallbackStorage(conf: SparkConf): Option[FallbackStorage] = 
this.synchronized {
+    if (conf != null && 
conf.get(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH).isDefined) {

Review Comment:
   I would prefer to have the fix in the unit test and not in the production 
code. Otherwise the next developer touching this code will be uncertain why 
having null checks for the config here and there and he might keep adding null 
checks to his new code. Moreover if the config would be optional it should be 
an `Option` but this mixed solution is a bit misleading.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to