Red Hat Bugzilla – Bug 985929
Jcr2vfs migration tool hangs and does not exit properly after finishing the migration
Last modified: 2014-08-06 15:58:27 EDT
Description of problem:
The jcr2vfs migration hangs and does not exit properly after the migration is completed. Seems like some background thread is preventing the app from exiting.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Get the jcr2vfs migration tool and unzip it into DIR.
2. Download and unzip attached mortgages-sample-repo.zip and unzip it into $DIR/bin/inputJcr
3. Run $DIR/bin/runMigration.sh script
After the migration ends the migration tool hangs and does not exit properly. It needs to be manually terminated.
The migration tool should correctly exit.
Issue is probably caused by non-daemon thread "Git-Daemon-Accept" that is not correctly shutdown after the migration. Seems like problem is in underlying Git VFS implementation.
There is workaround for the "Git-Daemon-Accept" thread, simply set system property "org.kie.nio.git.deamon.enabled" to "false" and the thread won't even start.
However, seems like that is not the only thread that is blocking the process from exiting. After analyzing the thread dump, I found "pool-4-thread-1" (the name can be different) is also still running as is related to uberfire backend:
Part of thread dump related to mentioned thread:
"pool-4-thread-1" prio=10 tid=0x00007fe6ad799000 nid=0x2517 waiting on condition [0x00007fe680ebe000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.uberfire.backend.server.config.ConfigurationServiceImpl$CheckConfigurationUpdates.run(ConfigurationServiceImpl.java:218) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724)
The git daemon thread was still running in non-daemon mode, so I disabled it as migration tool doesn't need it anyway. (Seems like the previous fix was applied only to master branch).
Issue is fixed, tested with community 6.0.x-SNAPSHOT. I will mark this as VERIFIED once the productized build arrives and I test it also there.
The migration tool in ER5 is broken. See https://bugzilla.redhat.com/show_bug.cgi?id=1034931 . I will try to verify this issue again in ER6. Please note that issue is fixed in community 6.0.0.Final.
Verified fixed in 6.0.0-ER7.
Reopening as the issue back. Tested with the current 6.0.2-SNAPSHOT.
Fix pushed to master and product branch:
This issue is fixed in community 6.0.2-SNAPSHOT, but not in 6.0.1-ER1. The commit probably arrived after the sync. I am moving this back to MODIFIED and will verify it with next build.
Verified fixed in 6.0.1-ER2.