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

Jgit doesn't shutdown thread executors #517

Open
spyrkob opened this issue Dec 7, 2023 · 0 comments
Open

Jgit doesn't shutdown thread executors #517

spyrkob opened this issue Dec 7, 2023 · 0 comments

Comments

@spyrkob
Copy link
Collaborator

spyrkob commented Dec 7, 2023

When using prospero in maven exec plugin, the execution reports lingering threads:

[WARNING] thread Thread[JGit-FileStoreAttributeReader-1,5,org.wildfly.prospero.cli.CliMain] was interrupted but is still alive after waiting at least 15000msecs
[WARNING] thread Thread[JGit-FileStoreAttributeReader-1,5,org.wildfly.prospero.cli.CliMain] will linger despite being asked to die via interruption
[WARNING] NOTE: 1 thread(s) did not finish despite being asked to via interruption. This is not a problem with exec:java, it is a problem with the running code. Although not serious, it should be remedied.
[WARNING] Couldn't destroy threadgroup org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=org.wildfly.prospero.cli.CliMain,maxpri=10]
java.lang.IllegalThreadStateException
    at java.lang.ThreadGroup.destroy (ThreadGroup.java:776)
    at org.codehaus.mojo.exec.ExecJavaMojo.execute (ExecJavaMojo.java:331)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)

This seems to be caused by jgit executors not being shut down. Part of fix is calling Git.shutdown(), but org.eclipse.jgit.util.FS executors are still not shutting down.

Below is an example pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.test.prospero</groupId>
    <artifactId>prospero-test</artifactId>
    <version>1.0.0.Final-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.wildfly.prospero</groupId>
            <artifactId>prospero-cli</artifactId>
            <version>1.2.2.Final-SNAPSHOT</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>multi-channel-provisioning-ee</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>org.wildfly.prospero.cli.CliMain</mainClass>
                            <commandlineArgs>install --dir=${project.build.directory}/wildfly-multi-channel --profile=wildfly --manifest=${project.basedir}/wildfly-29.0.0.Final-manifest.yaml</commandlineArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant