Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.4.0, 1.5.0
-
None
Description
The JarListHandler is responsible for listing all jars that have been uploaded via the webUI. Uploaded jars are stored in a temporary directory, and the handler simply iterates over the contents of this directory to create the listing.
File[] list = jarDir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".jar"); } }); // last modified ascending order Arrays.sort(list, (f1, f2) -> Long.compare(f2.lastModified(), f1.lastModified()));
This code will fail with a NullPointerException if the directory was deleted (like as part of some automatic cleanup). File#listFiles returns null in this case causing Arrays.sort to throw the NPE.
Attachments
Issue Links
- links to
GitHub user zentol opened a pull request:
https://github.com/apache/flink/pull/5331
FLINK-8473[webUI] Improve error behavior of JarListHandlerThis PR modifies the `JarListHandler` to not crash when the jar storage directory has been deleted. This caused the job-submission-page in the webUI to be completely blank.
We now log a warning (to make debugging easier) and continue on as if the directory was empty (so that the page isn't blank).
Manually verified and not covered by tests, like the rest of the handler.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zentol/flink 8473
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5331.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 #5331
commit c660166ce1818b08f7cd44da5cc504ed73d20177
Author: zentol <chesnay@...>
Date: 2018-01-22T12:29:34Z
FLINK-8473[webUI] Improve error behavior of JarListHandler