mridulm commented on PR #39883:
URL: https://github.com/apache/spark/pull/39883#issuecomment-1416922662

   If fixing this one occurance is enough to reduce the occurance drastically, 
let us do that in interest of 3.4
   We can create a jira to take a deeper look afterwards, and fix it for all.
   
   Perhaps something like this in future ?
   Logging.scala:
   ```
     private def isSparkContextActive = 
!SparkContext.getActive.map(_.isStopped).getOrElse(true)
   
     protected def logWarning(msg: => String, throwable: Throwable): Unit = {
       if (log.isWarnEnabled) {
         if (isSparkContextActive) {
           log.warn(msg, throwable)
         } else {
           log.warn(msg)
         }
       }
     }
   
     protected def logError(msg: => String, throwable: Throwable): Unit = {
       if (log.isErrorEnabled) {
         if (isSparkContextActive) {
           log.error(msg, throwable)
         } else {
           log.error(msg)
         }
       }
   }
   ```
   
   


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