You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2016/06/22 12:44:57 UTC

[jira] [Commented] (SPARK-16131) initialize internal logger lazily instead of manual null check

    [ https://issues.apache.org/jira/browse/SPARK-16131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15344249#comment-15344249 ] 

Apache Spark commented on SPARK-16131:
--------------------------------------

User 'infynyxx' has created a pull request for this issue:
https://github.com/apache/spark/pull/13842

> initialize internal logger lazily instead of manual null check
> --------------------------------------------------------------
>
>                 Key: SPARK-16131
>                 URL: https://issues.apache.org/jira/browse/SPARK-16131
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>            Reporter: Prajwal Tuladhar
>            Priority: Minor
>
> The way log instance inside Logger trait is current being initialized doesn't seem to be thread safe [1]. Current implementation only guarantees initializeLogIfNecessary() is initialized in lazy + thread safe way. 
> [1] https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/internal/Logging.scala#L44-L50
> This can be written as:
> {code}
> @transient private lazy val log_ : Logger = {
>     initializeLogIfNecessary(false)
>     LoggerFactory.getLogger(logName)
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org