Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/1222#discussion_r21582789
--- Diff:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
@@ -149,41 +162,45 @@ private[history] class FsHistoryProvider(conf:
SparkConf) extends ApplicationHis
* Tries to reuse as much of the data already in memory as possible, by
not reading
* applications that haven't been updated since last time the logs were
checked.
*/
- private def checkForLogs() = {
+ private[history] def checkForLogs() = {
lastLogCheckTimeMs = getMonotonicTimeMs()
logDebug("Checking for logs. Time is now
%d.".format(lastLogCheckTimeMs))
- try {
- val logStatus = fs.listStatus(new Path(logDir))
- val logDirs = if (logStatus != null) logStatus.filter(_.isDir).toSeq
else Seq[FileStatus]()
- // Load all new logs from the log directory. Only directories that
have a modification time
- // later than the last known log directory will be loaded.
+ try {
var newLastModifiedTime = lastModifiedTime
- val logInfos = logDirs
- .filter { dir =>
- if (fs.isFile(new Path(dir.getPath(),
EventLoggingListener.APPLICATION_COMPLETE))) {
- val modTime = getModificationTime(dir)
- newLastModifiedTime = math.max(newLastModifiedTime, modTime)
- modTime > lastModifiedTime
- } else {
- false
+ val statusList = Option(fs.listStatus(new Path(logDir))).map(_.toSeq)
+ .getOrElse(Seq[FileStatus]())
+ val logInfos = statusList
+ .filter { entry =>
+ try {
+ val isFinishedApplication =
+ if (isLegacyLogDirectory(entry)) {
+ fs.exists(new Path(entry.getPath(), APPLICATION_COMPLETE))
+ } else {
+
!entry.getPath().getName().endsWith(EventLoggingListener.IN_PROGRESS)
+ }
+
+ if (isFinishedApplication) {
+ val modTime = getModificationTime(entry)
+ newLastModifiedTime = math.max(newLastModifiedTime, modTime)
+ modTime >= lastModifiedTime
+ } else {
+ false
+ }
+ } catch {
+ case e: AccessControlException =>
+ // Do not use "logInfo" since these messages can get pretty
noisy if printed on
+ // every poll.
+ logDebug(s"No permission to read $entry, ignoring.")
--- End diff --
When do we get these?
---
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]