Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring-boot-maven-plugin:3.2.0:process-aot Get stuck #38938

Closed
yyyyyyyysssss opened this issue Dec 28, 2023 · 6 comments
Closed

spring-boot-maven-plugin:3.2.0:process-aot Get stuck #38938

yyyyyyyysssss opened this issue Dec 28, 2023 · 6 comments
Labels
status: duplicate A duplicate of another issue

Comments

@yyyyyyyysssss
Copy link

yyyyyyyysssss commented Dec 28, 2023

pom.xml

    <properties>
        <java.version>21</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>3.2.0</spring-boot.version>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.0</version>
        <relativePath/>
    </parent>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot.version}</version>
                <configuration>
                    <mainClass>com.example.techtest.TechTestApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <id>repackage</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>native</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <configuration>
                            <imageName>${project.artifactId}</imageName>
                            <mainClass>com.example.techtest.TechTestApplication</mainClass>
                            <skipNativeTests>true</skipNativeTests>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>

Running command:
mvn -Pnative native:compile

effect:

[INFO] --- spring-boot-maven-plugin:3.2.0:process-aot (process-aot) @ tech-spring-boot-starter ---

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.0)
2023-12-28T16:28:51.403+08:00  INFO 20128 --- [           main] c.example.techtest.TechTestApplication   : Starting TechTestApplication using Java 21.0.1 with PID 20128 (D:\WorkSpace\project\tech-test\target\classes started by 86188 in D:\WorkSpace\project\tech-test)
2023-12-28T16:28:51.406+08:00  INFO 20128 --- [           main] c.example.techtest.TechTestApplication   : The following 1 profile is active: "native"

Run here and get stuck

@yyyyyyyysssss
Copy link
Author

Please help me, thank you very much

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 28, 2023
@snicoll
Copy link
Member

snicoll commented Dec 29, 2023

@yyyyyyyysssss unfortunately, pasting your pom is not enough for us to figure out why AOT does not end as it should. You can know more by getting the PID of the process (using jps) and request a thread dump with jstack.

If that doesn't help please paste the thread dump here or share a small sample we can run ourselves to reproduce the problem.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Dec 29, 2023
@yyyyyyyysssss
Copy link
Author

yyyyyyyysssss commented Jan 2, 2024

@yyyyyyyysssss不幸的是,粘贴您的 pom 不足以让我们弄清楚为什么 AOT 没有按其应有的方式结束。您可以通过获取进程的 PID(使用jps)并使用 请求线程转储来了解更多信息jstack

如果这没有帮助,请将线程转储粘贴到此处或共享一个小示例,我们可以自己运行以重现问题。

This is my thread stack:

C:\Users\86188>jstack 16572
2024-01-02 09:30:04
Full thread dump Java HotSpot(TM) 64-Bit Server VM (21.0.1+12-jvmci-23.1-b19 mixed mode, sharing):

Threads class SMR info:
_java_thread_list=0x00000244605b2f00, length=12, elements={
0x000002446038c910, 0x000002446038d630, 0x00000244603911e0, 0x0000024460391d70,
0x0000024460392900, 0x0000024460393490, 0x0000024460394480, 0x00000244603971b0,
0x000002445f78ed60, 0x000002446054b4b0, 0x0000024400669d90, 0x0000024438119130
}

"Reference Handler" #9 [21180] daemon prio=10 os_prio=15 cpu=0.00ms elapsed=100.75s tid=0x000002446038c910 nid=21180 waiting on condition  [0x000000d593dff000]
   java.lang.Thread.State: RUNNABLE
        at java.lang.ref.Reference.waitForReferencePendingList(java.base@21.0.1/Native Method)
        at java.lang.ref.Reference.processPendingReferences(java.base@21.0.1/Reference.java:246)
        at java.lang.ref.Reference$ReferenceHandler.run(java.base@21.0.1/Reference.java:208)

"Finalizer" #10 [8848] daemon prio=8 os_prio=2 cpu=0.00ms elapsed=100.75s tid=0x000002446038d630 nid=8848 in Object.wait()  [0x000000d593efe000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait0(java.base@21.0.1/Native Method)
        - waiting on <0x00000006145b9748> (a java.lang.ref.NativeReferenceQueue$Lock)
        at java.lang.Object.wait(java.base@21.0.1/Object.java:366)
        at java.lang.Object.wait(java.base@21.0.1/Object.java:339)
        at java.lang.ref.NativeReferenceQueue.await(java.base@21.0.1/NativeReferenceQueue.java:48)
        at java.lang.ref.ReferenceQueue.remove0(java.base@21.0.1/ReferenceQueue.java:158)
        at java.lang.ref.NativeReferenceQueue.remove(java.base@21.0.1/NativeReferenceQueue.java:89)
        - locked <0x00000006145b9748> (a java.lang.ref.NativeReferenceQueue$Lock)
        at java.lang.ref.Finalizer$FinalizerThread.run(java.base@21.0.1/Finalizer.java:173)

"Signal Dispatcher" #11 [14332] daemon prio=9 os_prio=2 cpu=0.00ms elapsed=100.75s tid=0x00000244603911e0 nid=14332 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" #12 [2452] daemon prio=5 os_prio=2 cpu=0.00ms elapsed=100.75s tid=0x0000024460391d70 nid=2452 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Service Thread" #13 [8612] daemon prio=9 os_prio=0 cpu=0.00ms elapsed=100.75s tid=0x0000024460392900 nid=8612 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Monitor Deflation Thread" #14 [9244] daemon prio=9 os_prio=0 cpu=0.00ms elapsed=100.75s tid=0x0000024460393490 nid=9244 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JVMCI-native CompilerThread0" #15 [20884] daemon prio=9 os_prio=2 cpu=390.62ms elapsed=100.75s tid=0x0000024460394480 nid=20884 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"C1 CompilerThread0" #16 [12196] daemon prio=9 os_prio=2 cpu=62.50ms elapsed=100.75s tid=0x00000244603971b0 nid=12196 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"Common-Cleaner" #25 [3076] daemon prio=8 os_prio=2 cpu=0.00ms elapsed=100.73s tid=0x000002445f78ed60 nid=3076 waiting on condition  [0x000000d5946fe000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at jdk.internal.misc.Unsafe.park(java.base@21.0.1/Native Method)
        - parking to wait for  <0x00000006145c7098> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(java.base@21.0.1/LockSupport.java:269)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base@21.0.1/AbstractQueuedSynchronizer.java:1847)
        at java.lang.ref.ReferenceQueue.await(java.base@21.0.1/ReferenceQueue.java:71)
        at java.lang.ref.ReferenceQueue.remove0(java.base@21.0.1/ReferenceQueue.java:143)
        at java.lang.ref.ReferenceQueue.remove(java.base@21.0.1/ReferenceQueue.java:218)
        at jdk.internal.ref.CleanerImpl.run(java.base@21.0.1/CleanerImpl.java:140)
        at java.lang.Thread.runWith(java.base@21.0.1/Thread.java:1596)
        at java.lang.Thread.run(java.base@21.0.1/Thread.java:1583)
        at jdk.internal.misc.InnocuousThread.run(java.base@21.0.1/InnocuousThread.java:186)

"Notification Thread" #26 [16092] daemon prio=9 os_prio=0 cpu=0.00ms elapsed=100.71s tid=0x000002446054b4b0 nid=16092 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"keep-alive" #43 [7284] prio=5 os_prio=0 cpu=0.00ms elapsed=100.03s tid=0x0000024400669d90 nid=7284 waiting on condition  [0x000000d595dff000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep0(java.base@21.0.1/Native Method)
        at java.lang.Thread.sleep(java.base@21.0.1/Thread.java:509)
        at org.springframework.boot.SpringApplication$KeepAlive.run(SpringApplication.java:1657)

"DestroyJavaVM" #48 [12200] prio=5 os_prio=0 cpu=750.00ms elapsed=98.90s tid=0x0000024438119130 nid=12200 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"VM Thread" os_prio=2 cpu=0.00ms elapsed=100.77s tid=0x00000244380f1e20 nid=10564 runnable

"GC Thread#0" os_prio=2 cpu=0.00ms elapsed=100.78s tid=0x00000244380f2560 nid=11044 runnable

"GC Thread#1" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x00000244380f0fa0 nid=18612 runnable

"GC Thread#2" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x00000244380f1340 nid=12096 runnable

"GC Thread#3" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x00000244380f2900 nid=18876 runnable

"GC Thread#4" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x000002440025e0d0 nid=16624 runnable

"GC Thread#5" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x000002440025ceb0 nid=8652 runnable

"GC Thread#6" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x000002440025cb10 nid=12412 runnable

"GC Thread#7" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x000002440025c770 nid=2856 runnable

"GC Thread#8" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x000002440025d250 nid=10648 runnable

"GC Thread#9" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x000002440025bc90 nid=17316 runnable

"GC Thread#10" os_prio=2 cpu=0.00ms elapsed=100.36s tid=0x000002440025c3d0 nid=13740 runnable

"GC Thread#11" os_prio=2 cpu=0.00ms elapsed=100.09s tid=0x000002440025aa70 nid=2396 runnable

"GC Thread#12" os_prio=2 cpu=0.00ms elapsed=99.55s tid=0x000002440025e470 nid=2740 runnable

"G1 Main Marker" os_prio=2 cpu=0.00ms elapsed=100.78s tid=0x000002443a3ff730 nid=5220 runnable

"G1 Conc#0" os_prio=2 cpu=0.00ms elapsed=100.78s tid=0x00000244380f1a80 nid=7488 runnable

"G1 Conc#1" os_prio=2 cpu=0.00ms elapsed=99.55s tid=0x000002440025ae10 nid=5440 runnable

"G1 Conc#2" os_prio=2 cpu=0.00ms elapsed=99.55s tid=0x000002440025b1b0 nid=8372 runnable

"G1 Refine#0" os_prio=2 cpu=0.00ms elapsed=100.77s tid=0x000002445f65b420 nid=4148 runnable

"G1 Service" os_prio=2 cpu=0.00ms elapsed=100.77s tid=0x000002445f65cdb0 nid=13352 runnable

"VM Periodic Task Thread" os_prio=15 cpu=0.00ms elapsed=100.77s tid=0x000002445f78a6e0 nid=8948 waiting on condition

JNI global refs: 15, weak refs: 0

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 2, 2024
@yyyyyyyysssss
Copy link
Author

yyyyyyyysssss commented Jan 2, 2024

@yyyyyyyysssss unfortunately, pasting your pom is not enough for us to figure out why AOT does not end as it should. You can know more by getting the PID of the process (using jps) and request a thread dump with jstack.

If that doesn't help please paste the thread dump here or share a small sample we can run ourselves to reproduce the problem.

This is my configuration:

server:
  port: 8089
  tomcat:
    max-connections: 10000
    uri-encoding: UTF-8
    threads:
      max: 800
      min-spare: 10
    max-keep-alive-requests: 200
    keep-alive-timeout: 60s
    connection-timeout: 6s
    accept-count: 1000

spring:
  threads:
    virtual:
      enabled: true
  main:
    keep-alive: true
    allow-circular-references: true
    allow-bean-definition-overriding: true
  profiles:
    active: ${PROFILE:native}
  output:
    ansi:
      enabled: always

@yyyyyyyysssss
Copy link
Author

@yyyyyyyysssss unfortunately, pasting your pom is not enough for us to figure out why AOT does not end as it should. You can know more by getting the PID of the process (using jps) and request a thread dump with jstack.

If that doesn't help please paste the thread dump here or share a small sample we can run ourselves to reproduce the problem.

spring.main.keep-alive Change the configuration to false is work.
why? Set this property to the recommended value for springboot virtual threads

@wilkinsona
Copy link
Member

This has been fixed in 3.2.1. Duplicates #38531.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants