You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document thread group isolation limitation in java goal (#503)
* Document thread group isolation limitation in java goal
Add detailed documentation explaining that the java goal only tracks
threads in its isolated thread group, which causes it to exit early
when frameworks like RMI create non-daemon threads in other thread groups.
This clarifies the behavior reported in the issue where RMI servers
exit prematurely when using exec:java, and provides clear guidance
to use exec:exec as a workaround.
Co-authored-by: slachiewicz <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: slachiewicz <[email protected]>
in the system thread group, not in the plugin's isolated thread group.
117
+
118
+
* <<JMX>> - Similar to RMI, JMX remote connectors may create threads outside the isolated group.
119
+
120
+
* <<Other frameworks>> that manage their own thread pools or create threads using
121
+
the system thread group.
122
+
123
+
[]
124
+
125
+
In such cases, the plugin will exit when all threads in <<its own thread group>> have completed,
126
+
even though non-daemon threads may still be running in other thread groups. This can cause
127
+
servers or services to be terminated prematurely.
128
+
129
+
<<Workaround:>> If you need threads created by frameworks like RMI to keep the JVM alive,
130
+
use the {{{./exec-mojo.html}exec goal}} to run your Java program in a separate JVM process instead.
131
+
The exec goal spawns a new process which will behave like running <<<java>>> from the command line.
132
+
105
133
Read the documentation for the {{{./java-mojo.html}java goal}} for more information on how to configure this behavior.
106
134
107
135
If you find out that these differences are unacceptable for your case, you may need to use the {{{./exec-mojo.html} exec goal}} to wrap your Java executable.
0 commit comments