Code Monkey home page Code Monkey logo

Comments (3)

vorburger avatar vorburger commented on May 30, 2024

Agreed, and probably very easy to fix.. Do you want to send me a PR about
this? I would merge it ASAP.

On Thu, 30 Jul 2015 12:04 Christian Kaps [email protected] wrote:

The cleanupOnExit() ShutdownHook logs warnings if the directory, it tries
to delete, does not exists anymore. Currently I get warnings in my log,
also if the directories doesn't exists.

[warn] c.v.m.DB - cleanupOnExit() ShutdownHook: An error occurred while deleting a directory
java.io.IOException: Unable to delete directory /tmp/MariaDB4j/data/3333.
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1541) ~[commons-io-2.4.jar:2.4]
at ch.vorburger.mariadb4j.DB$1.run(DB.java:336) ~[mariaDB4j-2.1.3.jar:na]
[warn] c.v.m.DB - cleanupOnExit() ShutdownHook: An error occurred while deleting a directory
java.io.IOException: Unable to delete directory /tmp/MariaDB4j/data/3333.
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1541) ~[commons-io-2.4.jar:2.4]
at ch.vorburger.mariadb4j.DB$1.run(DB.java:336) ~[mariaDB4j-2.1.3.jar:na]
[warn] c.v.m.DB - cleanupOnExit() ShutdownHook: An error occurred while deleting a directory
java.io.IOException: Unable to delete file: /tmp/MariaDB4j/base/share/norwegian/errmsg.sys
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2279) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at ch.vorburger.mariadb4j.DB$1.run(DB.java:340) ~[mariaDB4j-2.1.3.jar:na]
[warn] c.v.m.DB - cleanupOnExit() ShutdownHook: An error occurred while deleting a directory
java.io.IOException: Unable to delete directory /tmp/MariaDB4j/base/share.
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1541) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at ch.vorburger.mariadb4j.DB$1.run(DB.java:340) ~[mariaDB4j-2.1.3.jar:na]
[warn] c.v.m.DB - cleanupOnExit() ShutdownHook: An error occurred while deleting a directory
java.io.IOException: Unable to delete file: /tmp/MariaDB4j/base/share/swedish/errmsg.sys
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2279) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2270) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1653) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1535) ~[commons-io-2.4.jar:2.4]
at ch.vorburger.mariadb4j.DB$1.run(DB.java:340) ~[mariaDB4j-2.1.3.jar:na]


Reply to this email directly or view it on GitHub
https://github.com/vorburger/MariaDB4j/issues/26.

from mariadb4j.

akkie avatar akkie commented on May 30, 2024

@vorburger I've looked at the code and there is already a check if the directory exists. So the main problem is that the shutdown hook isn't thread safe and therefore there is a race condition between the different shutdown hooks. So maybe a synchronized block is a better fix instead of suppressing the log message. What do you think?

from mariadb4j.

vorburger avatar vorburger commented on May 30, 2024

@akkie I've changed it to deleteQuietly() instead of deleteDirectory() and catch... makes sense to you?

PS: Sorry this one took so long! Life.

from mariadb4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.