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

Fix hanging files at instance destroy #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

diorcety
Copy link
Contributor

@diorcety diorcety commented Sep 9, 2015

When destroying the instance some file are still open for a while. For example if you try to delete the data directory just after destroy you can have some surprise. I took the example on org.apache.commons.io.FileSystemUtils#performCommand

@dmarkov
Copy link

dmarkov commented Sep 9, 2015

@diorcety Thanks for the pull request, let me find a reviewer..

@dmarkov
Copy link

dmarkov commented Sep 9, 2015

@yegor256 pull request is rather short, review it please

@yegor256
Copy link
Member

@rultor try to merge

@rultor
Copy link
Contributor

rultor commented Sep 11, 2015

@rultor try to merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Sep 11, 2015

@rultor try to merge

@diorcety @yegor256 Oops, I failed. You can see the full log here (spent 7min)

  InstancesTest.canReuseExistingDatabse:421 » IO Cannot run program "/home/r/rep...
  InstancesTest.canUseCustomDbDbName:314 » IO Cannot run program "/home/r/repo/t...
  InstancesTest.canUseCustomDbPassword:262 » IO Cannot run program "/home/r/repo...
  InstancesTest.canUseCustomDbUserName:207 » IO Cannot run program "/home/r/repo...
  InstancesTest.startsAndStops:97 » IO Cannot run program "/home/r/repo/target/m...
  InstancesTest.useOptions:151 » IO Cannot run program "/home/r/repo/target/mysq...
  InstancesTest.willCreateDatabaseEvenWithoutClear:365 » IO Cannot run program "...

Tests run: 10, Failures: 0, Errors: 7, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:28 min
[INFO] Finished at: 2015-09-11T10:36:19+00:00
[INFO] Final Memory: 37M/451M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jcabi-mysql-maven-plugin: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/r/repo/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jcabi-mysql-maven-plugin: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)
    at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:254)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:854)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@yegor256
Copy link
Member

@rultor try to merge again

@rultor
Copy link
Contributor

rultor commented Sep 13, 2015

@rultor try to merge again

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Sep 13, 2015

@rultor try to merge again

@diorcety @yegor256 Oops, I failed. You can see the full log here (spent 6min)

  InstancesTest.canReuseExistingDatabse:421 » IO Cannot run program "/home/r/rep...
  InstancesTest.canUseCustomDbDbName:314 » IO Cannot run program "/home/r/repo/t...
  InstancesTest.canUseCustomDbPassword:262 » IO Cannot run program "/home/r/repo...
  InstancesTest.canUseCustomDbUserName:207 » IO Cannot run program "/home/r/repo...
  InstancesTest.startsAndStops:97 » IO Cannot run program "/home/r/repo/target/m...
  InstancesTest.useOptions:151 » IO Cannot run program "/home/r/repo/target/mysq...
  InstancesTest.willCreateDatabaseEvenWithoutClear:365 » IO Cannot run program "...

Tests run: 10, Failures: 0, Errors: 7, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:04 min
[INFO] Finished at: 2015-09-13T10:32:34+00:00
[INFO] Final Memory: 38M/462M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jcabi-mysql-maven-plugin: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/r/repo/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jcabi-mysql-maven-plugin: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)
    at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:254)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:854)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

yegor256 pushed a commit that referenced this pull request Sep 13, 2015
@yegor256
Copy link
Member

@rultor try to merge now

@rultor
Copy link
Contributor

rultor commented Sep 13, 2015

@rultor try to merge now

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

yegor256 pushed a commit that referenced this pull request Sep 13, 2015
yegor256 pushed a commit that referenced this pull request Sep 13, 2015
@rultor
Copy link
Contributor

rultor commented Sep 13, 2015

@rultor try to merge now

@diorcety @yegor256 Oops, I failed. You can see the full log here (spent 40min)

  InstancesTest.canReuseExistingDatabse:421 » IO socket /tmp/1442142481258-0/mys...
  InstancesTest.canUseCustomDbDbName:314 » IO socket /tmp/1442143082385-0/mysql....
  InstancesTest.canUseCustomDbPassword:262 » IO socket /tmp/1442143382795-0/mysq...
  InstancesTest.canUseCustomDbUserName:222 » Communications Communications link ...
  InstancesTest.startsAndStops:97 » IO socket /tmp/1442142781903-0/mysql.sock is...
  InstancesTest.useOptions:151 » IO socket /tmp/1442143683085-0/mysql.sock is no...
  InstancesTest.willCreateDatabaseEvenWithoutClear:365 » IO socket /tmp/14421419...

Tests run: 10, Failures: 0, Errors: 7, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35:01 min
[INFO] Finished at: 2015-09-13T11:33:03+00:00
[INFO] Final Memory: 31M/463M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jcabi-mysql-maven-plugin: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/r/repo/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jcabi-mysql-maven-plugin: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)
    at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:254)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:854)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@yegor256
Copy link
Member

@rultor try again, merge

@rultor
Copy link
Contributor

rultor commented Sep 13, 2015

@rultor try again, merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Sep 13, 2015

@rultor try again, merge

@diorcety @yegor256 Oops, I failed. You can see the full log here (spent 14min)

[INFO] ..SUCCESS (51.5 s)
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO]   Passed: 4, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO] 
[INFO] --- qulice-maven-plugin:0.12:check (jcabi-check) @ jcabi-mysql-maven-plugin ---
[INFO] LICENSE found: file:/home/r/repo/LICENSE.txt
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[ERROR] /src/main/java/com/jcabi/mysql/maven/plugin/Instances.java[154]: Comments in method body are prohibited (MethodBodyCommentsCheck)
[ERROR] /src/main/java/com/jcabi/mysql/maven/plugin/Instances.java[154]: Line is longer than 80 characters (found 82). (LineLengthCheck)
[INFO] Read our quality policy: http://www.qulice.com/quality.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:34 min
[INFO] Finished at: 2015-09-13T11:47:51+00:00
[INFO] Final Memory: 46M/423M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.qulice:qulice-maven-plugin:0.12:check (jcabi-check) on project jcabi-mysql-maven-plugin: Failure: 2 Checkstyle violations (see log above) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.qulice:qulice-maven-plugin:0.12:check (jcabi-check) on project jcabi-mysql-maven-plugin: Failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: Failure
    at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:65)
    at com.qulice.maven.AbstractQuliceMojo.execute(AbstractQuliceMojo.java:175)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: com.qulice.spi.ValidationException: 2 Checkstyle violations (see log above)
    at com.qulice.checkstyle.CheckstyleValidator.validate(CheckstyleValidator.java:96)
    at com.qulice.maven.CheckMojo.run(CheckMojo.java:83)
    at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:59)
    ... 22 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@yegor256
Copy link
Member

@diorcety see the log above, there are a few static analysis violations, please fix them

@diorcety diorcety force-pushed the destroy_fix branch 2 times, most recently from b4ef9ff to e157fdc Compare September 15, 2015 11:37
@diorcety
Copy link
Contributor Author

I have updated the commit. I notice lot of print and exception when i stop a instance. There is missing a clean stop of threads and process. Here a modification to have a cleaner exit. Maybe you maybe improve it or, do it in you way. It pollutes a lot the output of my maven process and my ITs

@yegor256
Copy link
Member

yegor256 commented Oct 3, 2015

@diorcety please, try to run mvn clean install -Pqulice locally, you will see how many static problems your code has. Please fix them all and make sure Travis build is clean. We'll try to merge again then.

@yegor256
Copy link
Member

@diorcety can you please take a look at this one? It's a good PR, but has some problems and conflicts. If you fix them, I will try to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants