flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-8473) JarListHandler may fail with NPE if directory is deleted
Date Mon, 22 Jan 2018 12:42:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-8473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16334212#comment-16334212

ASF GitHub Bot commented on FLINK-8473:

GitHub user zentol opened a pull request:


    [FLINK-8473][webUI] Improve error behavior of JarListHandler

    ## What is the purpose of the change
    This 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).
    ## Verifying this change
    Manually verified and not covered by tests, like the rest of the handler.
    ## Does this pull request potentially affect one of the following parts:
      - Dependencies (does it add or upgrade a dependency): (no)
      - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
      - The serializers: (no)
      - The runtime per-record code paths (performance sensitive): (no)
      - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing,
Yarn/Mesos, ZooKeeper: (no)
      - The S3 file system connector: (no)
    ## Documentation
      - Does this pull request introduce a new feature? (no)
      - If yes, how is the feature documented? (not applicable)

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:


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


> JarListHandler may fail with NPE if directory is deleted
> --------------------------------------------------------
>                 Key: FLINK-8473
>                 URL: https://issues.apache.org/jira/browse/FLINK-8473
>             Project: Flink
>          Issue Type: Improvement
>          Components: Webfrontend
>    Affects Versions: 1.4.0, 1.5.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Major
>             Fix For: 1.5.0, 1.4.1
> 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.
> {code:java}
> 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()));{code}
> 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.

This message was sent by Atlassian JIRA

View raw message