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

    https://github.com/apache/spark/pull/1931#discussion_r16222813
  
    --- Diff: core/src/main/scala/org/apache/spark/ContextCleaner.scala ---
    @@ -65,11 +66,37 @@ private[spark] class ContextCleaner(sc: SparkContext) 
extends Logging {
       private val cleaningThread = new Thread() { override def run() { 
keepCleaning() }}
     
       /**
    +   * Keep track of the reference queue length and log an error if this 
exceeds a certain capacity.
    +   * Unfortunately, Java's ReferenceQueue exposes neither the queue length 
nor the enqueue method,
    +   * so we have to do this through reflection. This is expensive, however, 
so we should access
    +   * this field only once in a while.
    +   */
    +  private val queueCapacity = 10000
    +  private var queueFullErrorMessageLogged = false
    +  private val queueLengthAccessor: Option[Field] = {
    +    try {
    +      val f = 
classOf[ReferenceQueue[AnyRef]].getDeclaredField("queueLength")
    +      f.setAccessible(true)
    +      Some(f)
    +    } catch {
    +      case e: Exception =>
    +        logDebug("Failed to expose java.lang.ref.ReferenceQueue's 
queueLength field: " + e)
    --- End diff --
    
    Similar to the comment below, add a note.


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