taowenjun commented on code in PR #3360:
URL: https://github.com/apache/celeborn/pull/3360#discussion_r2349726996
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/TierWriter.scala:
##########
@@ -651,21 +652,28 @@ class DfsTierWriter(
hadoopFs.delete(dfsFileInfo.getDfsPath, false)
deleted = true
} else {
- hadoopFs.create(dfsFileInfo.getDfsWriterSuccessPath).close()
+ val retryCount = conf.workerCreateIndexOrSuccessMaxAttempts
+ val retryWait = conf.workerCreateIndexOrSuccessWaitMs
+ Utils.withRetryOnTimeoutOrIOException(retryCount, retryWait) {
+ hadoopFs.create(dfsFileInfo.getDfsWriterSuccessPath).close()
+ }
if (dfsFileInfo.isReduceFileMeta) {
- val indexOutputStream = hadoopFs.create(dfsFileInfo.getDfsIndexPath)
- val byteStream: ByteArrayOutputStream = new ByteArrayOutputStream()
- val dataStream = new DataOutputStream(byteStream)
- try {
-
dataStream.writeInt(dfsFileInfo.getReduceFileMeta.getChunkOffsets.size)
- for (offset <-
dfsFileInfo.getReduceFileMeta.getChunkOffsets.asScala) {
- dataStream.writeLong(offset)
+ Utils.withRetryOnTimeoutOrIOException(retryCount, retryWait) {
+ if (hadoopFs.exists(dfsFileInfo.getDfsIndexPath)) {
+ hadoopFs.delete(dfsFileInfo.getDfsIndexPath, true)
+ }
+ val indexOutputStream = hadoopFs.create(dfsFileInfo.getDfsIndexPath)
+ val byteStream: ByteArrayOutputStream = new ByteArrayOutputStream()
+ val dataStream = new DataOutputStream(byteStream)
+ try {
+
dataStream.writeInt(dfsFileInfo.getReduceFileMeta.getChunkOffsets.size)
+
dfsFileInfo.getReduceFileMeta.getChunkOffsets.asScala.foreach(dataStream.writeLong(_))
+ indexOutputStream.write(byteStream.toByteArray)
+ } finally if (dataStream != null) {
+ dataStream.close()
}
- indexOutputStream.write(byteStream.toByteArray)
- } finally if (dataStream != null) {
- dataStream.close()
+ indexOutputStream.close()
Review Comment:
Ok.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]