Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maks opened this issue Jan 12, 2021 · 4 comments
Closed

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

maks opened this issue Jan 12, 2021 · 4 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@maks
Copy link

maks commented Jan 12, 2021

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"
@mkustermann
Copy link
Member

This is due to #36648. We intend to solve as part of #36097

@vsmenon vsmenon added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Jan 12, 2021
@aam
Copy link
Contributor

aam commented Feb 2, 2021

Just to clarify - the issue demonstrated above with recharge package is not that non-main isolates are not hot-reloaded, rather that after a hot-reload, isolates spawned after_that(worker isolate in the repro above) don't have that hot-reload updates, instead spawned with the original source.

@gnprice
Copy link
Contributor

gnprice commented Dec 27, 2022

This is due to #36648. We intend to solve as part of #36097

Those two issues have been resolved. I just tried the repro recipe above, and confirmed that it no longer reproduces — at step 4, I see the new version of both strings.

That's with:

$ dart --version
Dart SDK version: 2.18.6 (stable) (Unknown timestamp) on "linux_x64"

So I believe this issue can be closed.

@maks
Copy link
Author

maks commented Dec 27, 2022

yes sorry I forgot about this issue.
I just retested myself with 2.18.6 on linux and concur its now fixed so I'll close this now.

@maks maks closed this as completed Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

5 participants