SerCeMan / jnr-fuse

FUSE implementation in Java using Java Native Runtime (JNR)
MIT License
365 stars 87 forks source link

Implementing flush hangs the java process #56

Open czeidler opened 6 years ago

czeidler commented 6 years ago

I'm testing my FS in a junit test. This worked fine till I implemented the flush method. The flush method prevents the test process from terminating (I have to kill the process manually). My flush method is empty, i.e. it just returns 0. Any idea what can cause fuse to hang?

SerCeMan commented 6 years ago

Hi, @czeidler!

No, I haven't encountered this behaviour before. What OS/java version are you using? Could you attach a test case that can help me to reproduce the problem?

czeidler commented 6 years ago

I'm running on Ubuntu 18.04 with Java 8. Here is my code:

https://gitlab.com/czeidler/fejoa

Run the test with: ./gradlew test -p fuse

This should succeed. To make it fail please add a default flush method to: fuse/src/main/kotlin/org/fejoa/fs/fusejnr/FejoaFuse.kt

override fun flush(path: String?, fi: FuseFileInfo?): Int {
    return super.flush(path, fi)
}

After running the test there is a zombie java process and a java process that I can only terminate by killing it. After killing it the test terminates but the zombie process remains. The zombie has systemd as parent (annoyingly, I believe this prevents my system to shutdown/fall asleep properly...)

czeidler commented 6 years ago

Or even simpler: add a flush method to MemoryFS and run the MemoryFSTest