program won't end (resolved) & java.nio.file.AccessDeniedException on Windows
See original GitHub issuethe following program will print done
, but won’t end normally.
def main(args: Array[String]): Unit = {
val map1: Map[String, String, Nothing, ApiIO] = persistent.Map[String, String, Nothing, ApiIO]("map1").get
map1.put("abc" -> "def", "123" -> "456").get
map1.foreach(println)
.materialize.get
map1.close().get
println("done")
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (18 by maintainers)
Top Results From Across the Web
Getting "java.nio.file.AccessDeniedException" when trying to ...
This folder has permissions set to full control for everyone on my computer (Windows). Does anybody know why I get this exception? Here's...
Read more >how to allow permissions to a java app deployed on tomcat
I have an application which is listening to ActiveMQ and it generates a zip file and upload it on the server. On Server...
Read more >AccessDeniedException caused by delayed file deletion on ...
Customer has been experiencing java.nio.file.AccessDeniedException in Windows family platforms intermittently. The exception is not thrown by an illegal access ...
Read more >Unable to start kafka with zookeeper (kafka.common ...
I solved this issue on my machine (Windows 10) by deleting the meta.properties file found in the log directory.
Read more >Job fails randomly when using copyArtifact - Jenkins Jira
Resolution : Won't Fix ... Windows 10x64 on master and slave-nodes ... WindowsFileSystemProvider.move(Unknown Source) at java.nio.file.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing this as it is resolved. Please reopen if needed.
This issue is now fixed in 0.14.6 release. All test-cases are passing on Windows 10. Please try re-running your code.
@Ectras you can now run your code without disabling mmap config.
As mentioned before, the problem was that Windows does not allow deleting memory-mapped files unless the file’s in-memory
MappedByteBuffer
is cleared.Solution
We now have a boolean
cleanBeforeDelete
flag inMMAP
(memory-mapped) configuration. IfcleanBeforeDelete
istrue
then as the name says, memory-mapped files get cleaned before they are deleted which gets rid of theAccessDeniedException
.You don’t really have to learn these configurations at all because the default instances are already pre-configured and I will document these configurations on the website in detail but here is a basic overview if you are interested.
deleteAfterClean
In the following snippets
deleteAfterClean
is enabled if the operating system is Windows.Java code looks like
ForceSave
ForceSave
is a new configuration (#251). On Windows callingforce
onMappedByteBuffer
is slower in certain situations (specially when copying memory-mapped) so this configuration was required. We can also disableforce
if we just want high performance and do not care about write guarantees on fatal machine crashes.What is force?
force
is just a function onMappedByteBuffer
that “Forces any changes made to this buffer’s content to be written to the storage device containing the mapped file - JavaDoc”.We can configure
force
to tell SwayDB when it should be invoked on files in any of the following 3 cases or we can disable it.