You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/05/14 20:05:04 UTC
[jira] [Commented] (FLINK-6370) FileAlreadyExistsException on
startup
[ https://issues.apache.org/jira/browse/FLINK-6370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16009832#comment-16009832 ]
ASF GitHub Bot commented on FLINK-6370:
---------------------------------------
GitHub user zentol opened a pull request:
https://github.com/apache/flink/pull/3896
[FLINK-6370] [webUI] Handle races for single file in FileServerHandler
This PR prevents a race between multiple requests trying to create the same file, which previously would cause one request to fail.
We can't just ignore the `FileAlreadyExistsException` since there's no guarantee that the file copying is complete. To prevent this scenario the copying is now done in a `synchronized` block, along with ignoring the `FileAlreadyExistsExceptions`.
Due to the small size of files loaded from the class-loader this should have no impact on the responsiveness of the webUI.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zentol/flink 6370_web_file
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/3896.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3896
----
commit 4ebee58fa8c39d0aa6d68d1470ea3a850e92b954
Author: zentol <ch...@apache.org>
Date: 2017-05-14T19:57:16Z
[FLINK-6370] [webUI] Handle races for single file in FileServerHandler
----
> FileAlreadyExistsException on startup
> -------------------------------------
>
> Key: FLINK-6370
> URL: https://issues.apache.org/jira/browse/FLINK-6370
> Project: Flink
> Issue Type: Bug
> Components: Webfrontend
> Affects Versions: 1.2.0
> Reporter: Andrey
> Assignee: Chesnay Schepler
>
> Currently static web resources are lazily cached onto disk during first request. However if 2 concurrent requests will be executed, then FileAlreadyExistsException will be in logs.
> {code}
> 2017-04-24 14:00:58,075 ERROR org.apache.flink.runtime.webmonitor.files.StaticFileServerHandler - error while responding [nioEventLoopGroup-3-2]
> java.nio.file.FileAlreadyExistsException: /flink/web/flink-web-528f8cb8-dd60-433c-8f6c-df49ad0b79e0/index.html
> at sun.nio.fs.UnixException.translateToIOException(UnixException.java:88)
> at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
> at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
> at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
> at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
> at java.nio.file.Files.newOutputStream(Files.java:216)
> at java.nio.file.Files.copy(Files.java:3016)
> at org.apache.flink.runtime.webmonitor.files.StaticFileServerHandler.respondAsLeader(StaticFileServerHandler.java:238)
> at org.apache.flink.runtime.webmonitor.files.StaticFileServerHandler.channelRead0(StaticFileServerHandler.java:197)
> at org.apache.flink.runtime.webmonitor.files.StaticFileServerHandler.channelRead0(StaticFileServerHandler.java:99)
> at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
> at io.netty.handler.codec.http.router.Handler.routed(Handler.java:62)
> {code}
> Expect:
> * extract all static resources on startup in main thread and before opening http port.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)