Skip to content

Integrate windows locking#980

Open
noha wants to merge 13 commits intomainfrom
integrate-windows-locking
Open

Integrate windows locking#980
noha wants to merge 13 commits intomainfrom
integrate-windows-locking

Conversation

@noha
Copy link
Contributor

@noha noha commented Nov 17, 2025

This is the integration PR for windows file locking

mumez and others added 11 commits November 13, 2025 22:34
Added basic Windows file lock support
  - Renamed WinOverlapped to SoilWinOverlappedStruct
  - Renamed WindowsFileLockTest to SoilWindowsFileLockTest
  - Removed unused fdatasync methods from BinaryFileStream extension
Added basic Windows file lock support
… isXXX testing methods and we can move more platform dependent code (ffi calls) to the corresponding platform class
@mumez
Copy link

mumez commented Nov 29, 2025

@noha
I'm starting to investigate why some tests are failing on Windows.

I've created an issue report describing what is happening.
#1001

@noha
Copy link
Contributor Author

noha commented Nov 30, 2025

@mumez Great! I've merged Marcus PR and I added to #destroy that it makes sure the database is closed before destroying. Now we have only 22 tests failing and different errors. Maybe you can figure those out?

@mumez
Copy link

mumez commented Dec 1, 2025

I think the other failures are more related to Soil's internal file handling behavior. I'll investigate this step by step.

@mumez
Copy link

mumez commented Dec 3, 2025

@noha
After carefully examining the source code, I fould a pattern in Soil's file stream handling that is non-portable (and carries a slight risk of corrupting files).
You can find the detailed issue report here: #1005.

@mumez
Copy link

mumez commented Dec 3, 2025

In CI, we observe many 'CannotDeleteFileException' failures. This error class is somewhat confusing, but the root cause is opening the same path in write mode on Windows.

Here is the code to reproduce the issue.

stream1 := SoilLockableStream path: 'same-path'.
stream2 := SoilLockableStream path: 'same-path'.

This code runs without errors on Mac/Linux, but raises a CannotDeleteFileException on Windows (actually indicating file lock error).

@noha noha added this to the Read-only support milestone Feb 19, 2026
@noha
Copy link
Contributor Author

noha commented Feb 19, 2026

@mumez A short note. I did not forget about this. We are busy and try to prepare a v4 release soon. The windows locking goes after that. I've created a read-only support milestone that should cover the topics in here meaning stream improvements and hopefully remove the incompatibilities for windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Windows Compatibility Issue: SoilLockableStream Multiple File Open Problem

2 participants