Github user shivaram commented on the pull request:

    https://github.com/apache/spark/pull/2028#issuecomment-52588649
  
    Hmm -- according to JLS [1], objects are only made available to other 
threads after the constructor finishes. So technically only one thread can call 
an object's constructor. However constructors are not thread safe if we expose 
a reference to `this` to other classes / threads [2].
    
    In this case I didn't see the reference leaking, but I guess it doesn't 
hurt to track down the callers to verify things.
    
    [1] http://docs.oracle.com/javase/specs/jls/se5.0/html/classes.html#8.8.3
    [2] 
http://stackoverflow.com/questions/4880168/why-cant-java-constructors-be-synchronized


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