Skip to content

Handle FIlesystems that don't support locking gracefully #204

Description

@cmhulbert

@mkitti mentioned on slack that when attempting to lock for reading a file over an SMB mount on MacOS, you get an OperationNotSupported Exception. (https://bugs.openjdk.org/browse/JDK-8167023). The JDK issues is from 2016, but I did test and this is still relevant, even with our current VolatileReadData #203 approach.

I tested this against the current 3.5.1 release and we do run into this, but we just let the user read anyway (this silently returns as if the lock succeeded on any IOException)

For the VolatileReadData, I'm thinking we can be a bit better about it. I'm proposing when we catch an IOException, we try to read without locking, but immediately materialize the full file, and then back the VolatileReadData with that. that would ensure future read are backed by the single materialize call, so even if the underlying filesystem changed, it should be consistent. Since we can't get the read lock, there isn't a strong guarantee that the data isn't changed during the materialize call itself, but that is a limitation of the filesystem, not our API.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions