Synchronous I/O functions from dart:io don't prevent an isolate group from hanging #57119
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-io
triaged
Issue has been triaged by sub team
type-enhancement
A request for a change that isn't a bug
This issue is in spirit a continuation of #51254; I'm just picking up where that issue left off.
I would have assumed that since that issue was closed and
Dart_EnterIsolate
/Dart_ExitIsolate
are now part of the public API,dart:io
's sync functions would have been updated to call these methods themselves. However this doesn't seem to be the case, and calling sync functions in many isolates at once can still cause an isolate group to hang.Example:
I would expect these functions to call
Dart_ExitIsolate
(or some internal equivalent) before running the blocking call (whether it bepoll
in the case ofProcess.runSync
,sleep
in the case ofsleep
or any other blocking native call) in order to allow other isolates in the isolate group to run. Maybe this could also be done when calling into FFIisLeaf: true
calls?I don't know of any other blocking functions in the SDK other than
dart:io
's, but if there are some it goes without saying the same should be done there.Tested on dart version
3.7.0-132.0.dev
and 73adec7The text was updated successfully, but these errors were encountered: