Comments (3)
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.
@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.
@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)
- Add test coverage for locally pre-installed MariaDB on Windows HOT 1
- GitHub Action to run Tests on Mac HOT 3
- New Windows GitHub Action fails due to Error: HttpError: Resource not accessible by integration HOT 1
- Clarify 2.x Maintenance HOT 3
- CodeQL Analyze GitHub Action fails with Connection timed out for https://repo.maven.apache.org HOT 1
- Support for sequences HOT 4
- Add ErrorProne Code Quality Tool HOT 1
- Before 3.0.1 release, mysql_install_db.exe: unknown variable 'tmpdir=C:\Users\Administrator\AppData\Local\Temp\MariaDB4j\tmp\54772 HOT 7
- Pre-Commit Hooks HOT 1
- Fix code scanning alert - Token-Permissions
- `root` with empty password security vulnerability. How to change the default password?
- MariaDB Wrapper on NPM for NodeJS / Deno #polyglot HOT 1
- Running DB with dump in Spring using Managedprocess HOT 1
- Thread will wait for "mysqld: ready for connections." to appear in Console output of process Program HOT 5
- Release 3.0.2 HOT 5
- MariaDB4j on Java 21 HOT 4
- JitPack of MariaDB4j 3.0.2+ is broken
- /tmp/MariaDB4j/base/bin/mariadbd: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory HOT 2
- Release 3.1.0 HOT 4
- 3.1.0 - "<path>" is not empty. Only new or empty existing directories are accepted for --datadir HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mariadb4j.