@jackmorris Hey, i found your very insightful blog post series regarding the SQLite wrapper. I wanted to have a quick look at the code and while building found this concurrency related warning. Do you happen to know this? To me it looks like it maybe will be fixed with region based isolation but since I saw your package had StructuredConcurrency enabled I thought you maybe had a closer look at this already. Attached is the screenshot of the particular warning.
@jackmorris What a lousy screenshot from my part 🙈 as I re-read my own post. This is in the connection actors async init, while Opener is an actor itself returning a non sendable OpaquePointer via open()
@dvk Interesting! Looks like this is a new warning, I didn't have this whilst writing the posts. The reason for the warning is that the non-Sendable ConnectionHandle (aka. an OpaquePointer) is being sent from the isolation of the Opener actor to that of the Connection. It's an over-conservative warning in this case (the handle is not retained within the Opener, so cannot be used from both isolation domains concurrently).
@dvk Best way to handle this? I _think_ that region-based isolation would silence this, but I was under the impression that had been released (although I'm not following the state of all of the proposals these days). You could silence the warning by wrapping the handle in a Sendable box (however that's just moving the responsibility to verify correctness to you).
@dvk You might be able to do something with non-copyable types to assert that the connection is moved out of the Opener - that might trigger the isolation-based analysis. That's all I have on the top of my head, sorry I couldn't be more help!
@jackmorris Thanks for getting back at me. This is of tremendous help. For now I "fixed" it by using the SendableBox approach. I think region based isolation is not yet released by merged to main. The non-copyable type however is something I was completely missing and I'll have a look at. Thanks again! :)