Bug 574686 - FileStoreAttributeReader threads are not stopped
Summary: FileStoreAttributeReader threads are not stopped
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.12   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-06 09:59 EDT by Pawel Veselov CLA
Modified: 2021-07-06 10:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Veselov CLA 2021-07-06 09:59:17 EDT
Similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=517107, using JGit/JGitRepository leaves a running thread behind.

This is a bit annoying as we are running JGit from a piece of code executed by exec-maven-plugin, which tries to stop all threads spawned by the called code to ensure clean exit:

[WARNING] thread Thread[JGit-FileStoreAttributeReader-1,5,xxx.ConfigureDocs] was interrupted but is still alive after waiting at least 15000msecs
[WARNING] thread Thread[JGit-FileStoreAttributeReader-1,5,xxx.ConfigureDocs] 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.

Use of JGit is supposedly fully contained:

        try {
            Repository gitRepo = new FileRepositoryBuilder().findGitDir().build()
            Git git = new Git(gitRepo, true)
            ...
        } finally {
            git.close()
        }

For the WorkerQueue we can at least invoke shutdown() directly, but so far I haven't found a way to stop the FileStoreAttributeReader thread.
Comment 1 Matthias Sohn CLA 2021-07-06 10:52:57 EDT
The FileStoreAttributeReader thread is a daemon thread hence I think there is no need to stop it.