Skip to content

"JSON-RPC error 105: Isolate must be runnable" during hot reload causes tool to crash #26568

@Hixie

Description

@Hixie

I hit R and the flutter tool crashed (and as far as I can tell, didn't report the exception anywhere):

Performing hot restart...                                       Error 105 received from application: Isolate must be runnable
Error 105 received from application: Isolate must be runnable
Unhandled exception:
JSON-RPC error 105: Isolate must be runnable
package:json_rpc_2/src/client.dart 110:64              Client.sendRequest
package:json_rpc_2/src/peer.dart 68:15                 Peer.sendRequest
package:flutter_tools/src/vmservice.dart 294:13        VMService._sendRequest
package:flutter_tools/src/vmservice.dart 827:12        VM.invokeRpcRaw
===== asynchronous gap ===========================
package:flutter_tools/src/vmservice.dart 1108:15       Isolate.invokeRpcRaw
package:flutter_tools/src/vmservice.dart 1220:12       Isolate.resume
package:flutter_tools/src/run_hot.dart 490:37          HotRunner._restartFromSources.<fn>
dart:async/zone.dart 1132:38                           _rootRunUnary
dart:async/zone.dart 1029:19                           _CustomZone.runUnary
dart:async/future_impl.dart 126:18                     _FutureListener.handleValue
dart:async/future_impl.dart 639:45                     Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 668:32                     Future._propagateToListeners
dart:async/future_impl.dart 473:7                      Future._complete
dart:async/future_impl.dart 51:12                      _SyncCompleter.complete
dart:async/runtime/libasync_patch.dart 28:18           _AsyncAwaitCompleter.complete
dart:async/runtime/libasync_patch.dart 294:13          _completeOnAsyncReturn
package:flutter_tools/src/vmservice.dart               ServiceObject.reload
===== asynchronous gap ===========================
package:flutter_tools/src/run_hot.dart 486:26          HotRunner._restartFromSources
===== asynchronous gap ===========================
package:flutter_tools/src/run_hot.dart 565:46          HotRunner.restart
===== asynchronous gap ===========================
package:flutter_tools/src/run_hot.dart 301:24          HotRunner.handleTerminalCommand
===== asynchronous gap ===========================
package:flutter_tools/src/resident_runner.dart 805:15  ResidentRunner.processTerminalInput
===== asynchronous gap ===========================
dart:async/zone.dart 1132:38                           _rootRunUnary
dart:async/zone.dart 1029:19                           _CustomZone.runUnary
dart:async/zone.dart 931:7                             _CustomZone.runUnaryGuarded
dart:async/stream_impl.dart 336:11                     _BufferingStreamSubscription._sendData
dart:async/stream_impl.dart 263:7                      _BufferingStreamSubscription._add
dart:async/broadcast_stream_controller.dart 375:20     _SyncBroadcastStreamController._sendData
dart:async/broadcast_stream_controller.dart 250:5      _BroadcastStreamController.add
dart:async/broadcast_stream_controller.dart 474:11     _AsBroadcastStreamController.add
dart:async/zone.dart 1132:38                           _rootRunUnary
dart:async/zone.dart 1029:19                           _CustomZone.runUnary
dart:async/zone.dart 931:7                             _CustomZone.runUnaryGuarded
dart:async/stream_impl.dart 336:11                     _BufferingStreamSubscription._sendData
dart:async/stream_impl.dart 263:7                      _BufferingStreamSubscription._add
dart:async/stream_transformers.dart 68:11              _SinkTransformerStreamSubscription._add
dart:async/stream_transformers.dart 15:11              _EventSinkWrapper.add
dart:convert/string_conversion.dart 238:11             _StringAdapterSink.add
dart:convert/string_conversion.dart 243:7              _StringAdapterSink.addSlice
dart:convert/string_conversion.dart 314:20             _Utf8ConversionSink.addSlice
dart:convert/ascii.dart 252:17                         _ErrorHandlingAsciiDecoderSink.addSlice
dart:convert/ascii.dart 238:5                          _ErrorHandlingAsciiDecoderSink.add
dart:convert/chunked_conversion.dart 74:18             _ConverterStreamEventSink.add
dart:async/stream_transformers.dart 120:24             _SinkTransformerStreamSubscription._handleData
dart:async/zone.dart 1132:38                           _rootRunUnary
dart:async/zone.dart 1029:19                           _CustomZone.runUnary
dart:async/zone.dart 931:7                             _CustomZone.runUnaryGuarded
dart:async/stream_impl.dart 336:11                     _BufferingStreamSubscription._sendData
dart:async/stream_impl.dart 263:7                      _BufferingStreamSubscription._add
dart:async/stream_controller.dart 764:19               _SyncStreamController._sendData
dart:async/stream_controller.dart 640:7                _StreamController._add
dart:async/stream_controller.dart 586:5                _StreamController.add
dart:io/runtime/binsocket_patch.dart 1722:41           _Socket._onData
dart:async/zone.dart 1136:13                           _rootRunUnary
dart:async/zone.dart 1029:19                           _CustomZone.runUnary
dart:async/zone.dart 931:7                             _CustomZone.runUnaryGuarded
dart:async/stream_impl.dart 336:11                     _BufferingStreamSubscription._sendData
dart:async/stream_impl.dart 263:7                      _BufferingStreamSubscription._add
dart:async/stream_controller.dart 764:19               _SyncStreamController._sendData
dart:async/stream_controller.dart 640:7                _StreamController._add
dart:async/stream_controller.dart 586:5                _StreamController.add
dart:io/runtime/binsocket_patch.dart 1284:33           new _RawSocket.<fn>
dart:io/runtime/binsocket_patch.dart 826:14            _NativeSocket.issueReadEvent.issue
dart:async/schedule_microtask.dart 41:21               _microtaskLoop
dart:async/schedule_microtask.dart 50:5                _startMicrotaskLoop
dart:isolate/runtime/libisolate_patch.dart 115:13      _runPendingImmediateCallback
dart:isolate/runtime/libisolate_patch.dart 172:5       _RawReceivePortImpl._handleMessage

The bug here isn't so much that hot restart failed, so much as the fact that the tool crashed. We should handle this much more gracefully.

cc @jonahwilliams @aam

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consolet: hot reloadReloading code during "flutter run"toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions