Weird behavior when running Spring Cloud Task applications with Spring Boot Native support #5886
Description
Description:
Because of the startup time we are currenty evaluating to migrate our Spring Cloud Task applications to Spring Boot Native.
We managed to get the native application running and uploading files to the s3 bucket, but there is a weird behavior of the native application compared to the java application in the Spring Cloud Data Flow UI.
Setup
-
We created an application with type
task
and Spring Boot versionSpring Boot 3.x
and URIdocker://...../<imagename>:<version>
(the docker image is a native image)
-
We did the same for a Java docker image. So there are two applications
s3-uploader-native-app
ands3-uploader-app
and two taskss3-uploader-native-task
ands3-uploader-task
-
We launched the task of the native application like the task of the java application
Outcome
-
Java Application: It runs like expected and if you click on the execution id everything is fine. (The task is listed at the side of the information)
-
Native Application: The application executed without any errors, but if you click on the execution id some information are missing (The task is NOT listed at the side of the information)
-
There is also a difference in the task executions view: The java application finished with the execution name
s3-uploader-task
. The native application finished with the execution names3-uploader-native-app
-
During the runtime however, the native task is executing with the correct name
s3-uploader-native-task
- it is switched tos3-uploader-native-app
when completed:
-
If you click on the name of the native task execution in the task executions view (not on the execution id) an error occurs and you are redirected to the task view
-
Also an error occurs if you click on the execution id and after this on the job execution id (I guess it is because the UI can't resolve the task execution for the job execution)
Release versions:
- Spring Boot 3.3.1 (tickets: Profiles are not active when the environment is prepared with an AOT-optimized application spring-projects/spring-boot#41562 / Resolving an environment variable for logging.config is not working for native builds spring-projects/spring-boot#41663)
- Spring Cloud Config 2023.0.2 / 4.1.3 (tickets: Native support for RetryTemplateFactory as it uses reflections to access the field logger of RetryTemplate spring-cloud/spring-cloud-config#2439)
- Spring Cloud AWS 3.1.1 (tickets: Introduce native support for config stores, core, SQS and SNS module awspring/spring-cloud-aws#856)
- AWS SDK V2 Java: (tickets: ClassNotFoundException after Spring Boot Native Image compilation for s3/internal/ApplyUserAgentInterceptor.java aws/aws-sdk-java-v2#5127)
- AWS CRT Java: (tickets: aws-crt-java causes an error when native compiled with graalvm awslabs/aws-crt-java#780 / GraalVM support with testing awslabs/aws-crt-java#749)
- Spring Cloud Data Flow 2.11.2: version.json
- Snappy-Java: (tickets: GraalVM: Caused by: org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] no native library is found for os.name=Linux and os.arch=x86_64 xerial/snappy-java#429) (This causes the error of prometheus rsocket client)
Custom apps:
N/A
Steps to reproduce:
- Create a simple Spring Cloud Task application with one Spring Batch job configuration and one Spring Batch step
- Use
native-image
of Liberica NIK orspring-boot-maven-plugin
withpacketo buildpacks
to create a native image of the Spring Cloud Task application - Register the application like explained in the description
Screenshots:
See description
Additional context:
When I manually change the name of any task execution in the database from s3-uploader-native-app
to s3-uploader-native-task
everthing is like it should be.