Skip to content

VM service does not hot reload non-main Isolates #44640

Closed
@maks

Description

@maks

Using the vm service package it should be possible to use the reloadSources to hot reload an Isolate from changes made to the src file on disk.

With current master of the Dart SDK this seems to work fine using the DartVM in JIT mode on the commandline with the main isolate but not with any isolate's spawned from the main isolate.

This seems to have been reported in several different Flutter issues:

This was supposedly fixed for Flutter in this change as part of flutter/flutter#52149 but I don't see how that could actually be working at the moment as I am seeing that it doesn't work with just the standalone Dart SDK.

I created a modified version of the recharge package that demonstrates this issue.

To reproduce:

  1. clone the above repo and use the background-isolate-test branch, run: dart --enable-vm-service example/hello.dart
  2. edit hello.dart changing the value returned by mesg() and the print inside worker()
  3. note the pid printed out from step 1 and send it a sigusr1, eg kill -n 10 <pid-of-example>
  4. notice that the output will show the new value of mesg() but NOT of the worker's print()

The version I have been testing with is built locally:

dart --version
Dart SDK version: 2.12.0-edge.30c4006d52fad4ee8b92025933b9f17af7a8740f (be) (Thu Dec 31 00:48:50 2020 +0000) on "linux_x64"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions