Skip to content

Pub: Spawning isolate it transformer not possible #23105

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
DartBot opened this issue Apr 6, 2015 · 3 comments
Closed

Pub: Spawning isolate it transformer not possible #23105

DartBot opened this issue Apr 6, 2015 · 3 comments

Comments

@DartBot
Copy link

DartBot commented Apr 6, 2015

This issue was originally filed by @Fox32


What steps will reproduce the problem?

  1. Create an own pub transformer
  2. Spawn a isolate using Isolate.spawn in Transformer.apply

What is the expected output? What do you see instead?

I would like to spawn a new isolate but instead I get the following exception:

in ShutdownIsolate: Unhandled exception:
Uncaught Error: IsolateSpawnException: Unhandled exception:
Uncaught Error: Load Error: FileSystemException: Cannot open file, path = 'C:\Users\Oliver\AppData\Local\Temp\pub_2d41cbb2-dc5b-11e4-bec2-90e6ba20879e\runInIsolate.dart' (OS Error: Das System kann den angegebenen Pfad nicht finden., errno = 3)
Stack Trace:

­0 _asyncLoadErrorCallback (dart:_builtin:268)

­1 _asyncLoadError (dart:_builtin:287)

­2 _loadDataAsyncLoadPort.<anonymous closure> (dart:_builtin:304)

­3 _RootZone.runUnary (dart:async/zone.dart:1155)

­4 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:494)

­5 _Future._propagateToListeners (dart:async/future_impl.dart:577)

­6 _Future._complete (dart:async/future_impl.dart:358)

­7 _cancelAndValue (dart:async/stream_pipe.dart:62)

­8 Stream.first.<anonymous closure> (dart:async/stream.dart:911)

­9 _RootZone.runUnaryGuarded (dart:async/zone.dart:1093)

­10 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)

­11 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)

­12 _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/s

tream_controller.dart:698)

­13 _StreamController._add (dart:async/stream_controller.dart:570)

­14 _StreamController.add (dart:async/stream_controller.dart:516)

­15 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:142)

­0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:886)

­1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)

­2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)

­3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)

­4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)

Stack Trace:

­0 Isolate._spawnFunction (dart:isolate-patch/isolate_patch.dart:347)

­1 Isolate.spawn (dart:isolate-patch/isolate_patch.dart:277)

­2 ImageTransformer.apply.<apply_async_body> (package:image_transformer/image_transformer.dart:76:15)

­3 _RootZone.runUnary (dart:async/zone.dart:1155)

­4 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:494)

­5 _Future._propagateToListeners (dart:async/future_impl.dart:577)

­6 _Future._completeWithValue (dart:async/future_impl.dart:368)

­7 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:422)

­8 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)

­9 _asyncRunCallback (dart:async/schedule_microtask.dart:48)

­10 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)

­11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)

­0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:886)

­1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)

­2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)

­3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)

­4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)

What version of the product are you using?
Dart Editor version 1.10.0.dev_00_01 (DEV)
Dart SDK version 1.10.0-dev.0.1

On what operating system?
Windows 8.1 64bit

Please provide any additional information below.

Sometimes it would be useful to spawn an additional isolate to do multiple computation heavy operations in parallel. I think this problem is known and currently by design, but it the future it would be a nice addition.
Maybe it would work if pub wouldn't delete the runInIsolate.dart file in the temp folder intermediately, but on exiting pub?

@iposva-google
Copy link
Contributor

Added Area-Pub, Triaged labels.

@nex3
Copy link
Member

nex3 commented Apr 7, 2015

This is caused by a VM issue (issue #6610) wherein existing script data isn't reused for Isolate.spawn. I don't think it's worth adding additional workarounds in pub rather than just solving the underlying problem.

It's worth noting that each transformer already runs in its own isolate, so it's unlikely that additional per-transformer parallelism is going to buy you a whole lot of value.


Marked this as being blocked by #6610.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

This issue has been moved to dart-lang/pub#7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants