Will FileChannel.lock mutex work across mutliple containers or nodes

4/11/2018

I'm building a file system based repository as an alternative to my database based repositories. I was planning on using a FileChannel.lock based mutex for concurrency, but then I thought this might not work when the 2+ processes are run from separate containers (separate nodes even) in a kubernetes cluster with a shared volume mount for the filesystem. Does anyone know if the lock will be recognized in this scenario or if it will only work within the same container or system.

-- Novaterata
docker
java
kubernetes
mutex

0 Answers