vanzin commented on a change in pull request #25819: [SPARK-29105][core] Keep
driver log file size up to date in HDFS.
URL: https://github.com/apache/spark/pull/25819#discussion_r325404583
##########
File path: core/src/main/scala/org/apache/spark/util/logging/DriverLogger.scala
##########
@@ -131,12 +133,20 @@ private[spark] class DriverLogger(conf: SparkConf)
extends Logging {
}
try {
var remaining = inStream.available()
+ val hadData = remaining > 0
while (remaining > 0) {
val read = inStream.read(tmpBuffer, 0, math.min(remaining,
UPLOAD_CHUNK_SIZE))
outputStream.write(tmpBuffer, 0, read)
remaining -= read
}
- outputStream.hflush()
+ if (hadData) {
+ outputStream match {
+ case hdfsStream: HdfsDataOutputStream =>
+
hdfsStream.hsync(EnumSet.allOf(classOf[HdfsDataOutputStream.SyncFlag]))
Review comment:
That's probably a good idea.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]