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

Concurrent .embedmongo creation error #141

Open
Geminist opened this issue Jan 6, 2025 · 1 comment
Open

Concurrent .embedmongo creation error #141

Geminist opened this issue Jan 6, 2025 · 1 comment
Assignees
Labels

Comments

@Geminist
Copy link

Geminist commented Jan 6, 2025

Issue in the

Try.run(() -> java.nio.file.Files.createDirectory(baseDir));

Version 4.15.1

Caused by: java.lang.RuntimeException: java.nio.file.FileAlreadyExistsException: /home/jenkins/.embedmongo
	at de.flapdoodle.types.ThrowingRunnable.lambda$mapException$0(ThrowingRunnable.java:33)
	at de.flapdoodle.types.Try.run(Try.java:50)
	at de.flapdoodle.embed.process.store.LocalDownloadCache.<init>(LocalDownloadCache.java:54)
...
	at de.flapdoodle.reverse.transitions.Start$WithDestination.lambda$providedBy$1(Start.java:86)
	at de.flapdoodle.reverse.transitions.Start.result(Start.java:52)
	at de.flapdoodle.reverse.TransitionWalker.resolve(TransitionWalker.java:58)
	at de.flapdoodle.reverse.TransitionWalker.resolve(TransitionWalker.java:46)
	at de.flapdoodle.reverse.TransitionWalker.initState(TransitionWalker.java:180)

I think that something like this is enough:

try {
    Files.createDirectory(baseDir);
} catch (final FileAlreadyExistsException e) {
// ignore
}

Or may be it;s possible to add feature to ThrowingConsumer to allow some exceptions to be ignored.

@michaelmosmann
Copy link
Member

@Geminist .. ah.. yes.. thanks. I will fix that:)

@michaelmosmann michaelmosmann self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants