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

Konstantin Shaposhnikov commented on SPARK-8122:
------------------------------------------------

Parquet itself surfers from this issue too but its almost impossible to hit it 
because the static block in Log is most likely called very shortly before some 
Logger instance is strongly referenced from a static LOG field (Log -> Logger 
-> parent Logger). It is very unlikely that GC happens between these two events.

But when there is a bigger interval between a Logger is configured in 
`enableLogForwarding()` and is actually used to log something there is a bigger 
chance to see this.

In one of my applications I used similar code to redirect parquet logging to 
slf4j and saw once that the redirect wasn't setup properly due to GC.

To be honest I wish parquet just used slf4j and didn't mess with logging set up 
;)

> ParquetRelation.enableLogForwarding() may fail to configure loggers
> -------------------------------------------------------------------
>
>                 Key: SPARK-8122
>                 URL: https://issues.apache.org/jira/browse/SPARK-8122
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 1.5.0
>            Reporter: Konstantin Shaposhnikov
>            Priority: Minor
>
> _enableLogForwarding()_ doesn't hold to the created loggers that can be 
> garbage collected and all configuration changes will be gone. From 
> https://docs.oracle.com/javase/6/docs/api/java/util/logging/Logger.html 
> javadocs:  _It is important to note that the Logger returned by one of the 
> getLogger factory methods may be garbage collected at any time if a strong 
> reference to the Logger is not kept._
> All created logger references need to be kept, e.g. in static variables.



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

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

Reply via email to