You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/06/25 11:45:20 UTC

[GitHub] [flink] NicoK commented on a change in pull request #7197: [FLINK-12909][flink-runtime] add try catch when find a unique file name for the spilling channel

NicoK commented on a change in pull request #7197: [FLINK-12909][flink-runtime] add try catch when find a unique file name for the spilling channel
URL: https://github.com/apache/flink/pull/7197#discussion_r297139614
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpillingAdaptiveSpanningRecordDeserializer.java
 ##########
 @@ -634,8 +638,12 @@ private FileChannel createSpillingChannel() throws IOException {
 			for (int attempt = 0; attempt < maxAttempts; attempt++) {
 				String directory = tempDirs[rnd.nextInt(tempDirs.length)];
 				spillFile = new File(directory, randomString(rnd) + ".inputchannel");
-				if (spillFile.createNewFile()) {
-					return new RandomAccessFile(spillFile, "rw").getChannel();
+				try {
+					if (spillFile.createNewFile()) {
+						return new RandomAccessFile(spillFile, "rw").getChannel();
+					}
+				} catch (IOException e) {
+					LOG.warn("Exception while find a unique file name for the spilling channel, try it again.", e);
 
 Review comment:
   You should give more context and improve the message a bit, maybe something like
   ```
   LOG.warn("Failed to create spilling channel on {}, trying again.", spillFile.getCanonicalPath(), e);
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services