Skip to content

Conversation

@snuyanzin
Copy link
Contributor

What is the purpose of the change

Since because of JEP411 [1] starting from java 18 default value of java.security.manager will be disallow the PR adds allow optio where it is needed

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

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, Kubernetes/Yarn, 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 )

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 18, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@zentol zentol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also needs to be added to env.java.opts.all in flink-conf.yaml

@zentol zentol self-assigned this Oct 20, 2023
@snuyanzin
Copy link
Contributor Author

snuyanzin commented Oct 23, 2023

thanks,
in fact explicit set of -Djava.security.manager=allow for java.opts.all in flink-conf.yaml leads to the same issue in ci[1] as mentioned in pom's comments

For that reason i put it in comments in flink-conf.yaml

UPD: Another idea is to add logic to config.sh which could add this parameter for java 21+ similar to the way how it is done in Ant [2]

[1] https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=53933&view=results
[2] apache/ant@0b028a2

@snuyanzin snuyanzin requested a review from zentol October 23, 2023 12:03
@snuyanzin
Copy link
Contributor Author

@flinkbot run azure

Comment on lines 338 to 342
JAVA_SPEC_VERSION=`"${JAVA_RUN}" -XshowSettings:properties 2>&1 | grep "java.specification.version" | cut -d "=" -f 2 | tr -d '[:space:]'`
if [ "$JAVA_SPEC_VERSION" == "21" ]; then
# set security manager property to allow calls to System.setSecurityManager() at runtime
FLINK_ENV_JAVA_OPTS="$FLINK_ENV_JAVA_OPTS -Djava.security.manager=allow"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How compatible is this across JDK vendors?
This is gonna be annoying maintenance-wise because java 18,19,20 and 22 will all fail out-of-the-box.

Copy link
Contributor Author

@snuyanzin
Copy link
Contributor Author

@flinkbot run azure

FLINK_ENV_JAVA_OPTS="-XX:+IgnoreUnrecognizedVMOptions $( echo "${FLINK_ENV_JAVA_OPTS}" | sed -e 's/^"//' -e 's/"$//' )"

JAVA_SPEC_VERSION=`"${JAVA_RUN}" -XshowSettings:properties 2>&1 | grep "java.specification.version" | cut -d "=" -f 2 | tr -d '[:space:]'`
if [[ $(echo "$JAVA_SPEC_VERSION > 17" | bc ) == "1" ]]; then
Copy link
Contributor

@zentol zentol Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bc isn't available in our CI image. any reason this cant use plain bash arithmetic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I should have been checking that failure
the issue was with jdk 8 for which it returns 1.8

finally i replaced bc with usage of substring from latest dot till end

@snuyanzin snuyanzin requested a review from zentol November 2, 2023 22:19
@zentol zentol merged commit 7295c3b into apache:master Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants