[
https://issues.apache.org/jira/browse/FLINK-6176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15945127#comment-15945127
]
ASF GitHub Bot commented on FLINK-6176:
---------------------------------------
GitHub user greghogan opened a pull request:
https://github.com/apache/flink/pull/3632
[FLINK-6176] [scripts] Add JARs to CLASSPATH deterministically
Sorts files read from Flink's lib directory and places the distribution JAR
to the end of the CLASSPATH.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/greghogan/flink
6176_add_jars_to_classpath_deterministically
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/3632.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 #3632
----
commit 19800b2b943a1208144607902df7d570ba968f63
Author: Greg Hogan <[email protected]>
Date: 2017-03-26T19:46:00Z
[FLINK-6176] [scripts] Add JARs to CLASSPATH deterministically
Sorts files read from Flink's lib directory and places the distribution
JAR to the end of the CLASSPATH.
----
> Add JARs to CLASSPATH deterministically
> ---------------------------------------
>
> Key: FLINK-6176
> URL: https://issues.apache.org/jira/browse/FLINK-6176
> Project: Flink
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2.0
> Reporter: Scott Kidder
> Assignee: Greg Hogan
>
> The {{config.sh}} script uses the following shell-script function to build
> the {{FLINK_CLASSPATH}} variable from a listing of JAR files in the
> {{$FLINK_LIB_DIR}} directory:
> {code}
> constructFlinkClassPath() {
> while read -d '' -r jarfile ; do
> if [[ $FLINK_CLASSPATH = "" ]]; then
> FLINK_CLASSPATH="$jarfile";
> else
> FLINK_CLASSPATH="$FLINK_CLASSPATH":"$jarfile"
> fi
> done < <(find "$FLINK_LIB_DIR" ! -type d -name '*.jar' -print0)
> echo $FLINK_CLASSPATH
> }
> {code}
> The {{find}} command as specified will return files in directory-order, which
> varies by OS and filesystem.
> The inconsistent ordering of directory contents caused problems for me when
> installing a Flink Docker image onto new machine with a newer version of
> Docker and different filesystem (UFS). The differences in the Docker
> filesystem implementation led to different ordering of the directory
> contents; this affected the {{FLINK_CLASSPATH}} ordering and generated very
> puzzling {{NoClassNotFoundException}} errors when running my Flink
> application.
> This should be addressed by deterministically ordering JAR files added to the
> {{FLINK_CLASSPATH}}.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)