Skip to content

Long Running Isolates / FFI Calls Break Hot Reloading -> willReassemble Method Needed #59061

@gatzsche

Description

@gatzsche

I'm writing a Flutter Plugin which starts long-running C-Functions inside an isolate via FFI. The problem: Hot reloading is broken as long as the C function is executed.

I could easily stop the C function before executing the hot reload. To do this a callback informing me of an upcoming hot reload is needed. Currently, I can override reassemble as stated at StackOverflow. But this function is only called after a hot reload, not before.

In addition to the reassemble method, we need a willReassemble method informing us about an upcoming hot reload. I can then stop my long-running isolate.

Check out the example flutter plugin demonstrating the issue:
https://github.com/gatzsche/flutter-dart-ffi-hotreload-issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listdependency: dartDart team may need to help usengineflutter/engine related. See also e: labels.found in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions