Skip to content
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

handleMessage in HttpClient goes through too many (zone/async) redirections #12314

Open
iposva-google opened this issue Aug 8, 2013 · 5 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-a library-async type-enhancement A request for a change that isn't a bug

Comments

@iposva-google
Copy link
Contributor

iposva-google commented Aug 8, 2013

Looked at some random error from a flaky test. The answer is about 60 frames too many:

# ­0      Expect._fail (package:expect/expect.dart:368:5)
# ­1      Expect.fail (package:expect/expect.dart:154:10)
# ­2      VmServiceRequestHelper.onRequestFailed (file:///e:/b/build/slave/vm-win32-release/build/dart/tests/standalone/vmservice/test_helper.dart:69:16)
# ­3      VmServiceRequestHelper.makeRequest.<anonymous closure> (file:///e:/b/build/slave/vm-win32-release/build/dart/tests/standalone/vmservice/test_helper.dart:32:24)
# ­4      _CatchErrorFuture._zonedSendError (dart:async/future_impl.dart:409:24)
# ­5      _TransformFuture._sendError.<anonymous closure> (dart:async/future_impl.dart:351:48)
# ­6      _ZoneBase._runInZone (dart:async/zone.dart:74:15)
# ­7      _ZoneBase._runUnguarded (dart:async/zone.dart:102:22)
# ­8      _ZoneBase.executeCallback (dart:async/zone.dart:58:23)
# ­9      _TransformFuture._sendError (dart:async/future_impl.dart:351:26)
# ­10     _FutureImpl._setErrorUnchecked (dart:async/future_impl.dart:211:26)
# ­11     _FutureImpl._setError (dart:async/future_impl.dart:189:23)
# ­12     _ThenFuture._zonedSendValue (dart:async/future_impl.dart:374:16)
# ­13     _TransformFuture._sendValue.<anonymous closure> (dart:async/future_impl.dart:348:48)
# ­14     _ZoneBase._runInZone (dart:async/zone.dart:74:15)
# ­15     _ZoneBase._runUnguarded (dart:async/zone.dart:102:22)
# ­16     _ZoneBase.executeCallback (dart:async/zone.dart:58:23)
# ­17     _TransformFuture._sendValue (dart:async/future_impl.dart:348:26)
# ­18     _FutureImpl._setValueUnchecked (dart:async/future_impl.dart:184:26)
# ­19     _FutureImpl._setValue (dart:async/future_impl.dart:174:23)
# ­20     Stream.fold.<anonymous closure> (dart:async/stream.dart:118:23)
# ­21     _ZoneBase._runInZone (dart:async/zone.dart:82:17)
# ­22     _ZoneBase._runGuarded (dart:async/zone.dart:99:22)
# ­23     _ZoneBase.executeCallbackGuarded (dart:async/zone.dart:62:21)
# ­24     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:210:33)
# ­25     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:153:16)
# ­26     _EventSinkAdapter.close (dart:async/stream.dart:539:17)
# ­27     _FilterTransformer.handleDone (data_transformer.dart:47:15)
# ­28     _handleDone (dart:async/stream.dart:521:30)
# ­29     _ZoneBase._runInZone (dart:async/zone.dart:82:17)
# ­30     _ZoneBase._runGuarded (dart:async/zone.dart:99:22)
# ­31     _ZoneBase.executeCallbackGuarded (dart:async/zone.dart:62:21)
# ­32     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:210:33)
# ­33     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:153:16)
# ­34     _ForwardingStream._handleDone (dart:async/stream_pipe.dart:45:16)
# ­35     _handleDone (dart:async/stream_pipe.dart:85:24)
# ­36     _ZoneBase._runInZone (dart:async/zone.dart:82:17)
# ­37     _ZoneBase._runGuarded (dart:async/zone.dart:99:22)
# ­38     _ZoneBase.executeCallbackGuarded (dart:async/zone.dart:62:21)
# ­39     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:210:33)
# ­40     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:153:16)
# ­41     _StreamController&_SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:204:25)
# ­42     _StreamController.close (dart:async/stream_controller.dart:122:16)
# ­43     _HttpParser._closeIncoming (http_parser.dart:677:28)
# ­44     _HttpParser._doParse (http_parser.dart:461:23)
# ­45     _HttpParser._parse (http_parser.dart:160:15)
# ­46     _onData (http_parser.dart:510:11)
# ­47     _BufferingStreamSubscription._sendData.<anonymous closure> (dart:async/stream_impl.dart:184:55)
# ­48     _ZoneBase._runInZone (dart:async/zone.dart:82:17)
# ­49     _ZoneBase._runGuarded (dart:async/zone.dart:99:22)
# ­50     _ZoneBase.executePeriodicCallbackGuarded (dart:async/zone.dart:68:21)
# ­51     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:184:41)
# ­52     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:135:16)
# ­53     _StreamController&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:198:23)
# ­54     _StreamController._add (dart:async/stream_controller.dart:130:16)
# ­55     _StreamController.add (dart:async/stream_controller.dart:104:9)
# ­56     _onData (dart:io-patch/socket_patch.dart:830:42)
# ­57     _BufferingStreamSubscription._sendData.<anonymous closure> (dart:async/stream_impl.dart:184:55)
# ­58     _ZoneBase._runInZone (dart:async/zone.dart:82:17)
# ­59     _ZoneBase._runGuarded (dart:async/zone.dart:99:22)
# ­60     _ZoneBase.executePeriodicCallbackGuarded (dart:async/zone.dart:68:21)
# ­61     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:184:41)
# ­62     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:135:16)
# ­63     _StreamController&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:198:23)
# ­64     _StreamController._add (dart:async/stream_controller.dart:130:16)
# ­65     _StreamController.add (dart:async/stream_controller.dart:104:9)
# ­66     _RawSocket._RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:547:52)
# ­67     _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:347:39)
# ­68     _NativeSocket.connectToEventHandler.<anonymous closure> (dart:io-patch/socket_patch.dart:432:54)
# ­69     _ReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:81:92)
@iposva-google
Copy link
Contributor Author

cc @a-siva.

@sgjesse
Copy link
Contributor

sgjesse commented Aug 9, 2013

The dart:async abstractions does come with a cost as the frames are dominated by dart:async code.

Looking at the bottom of the stack, then frames 65-57 and 55-47 are handling adding data to a sync StreamController. When there is a listener and the stream is not paused this is a direct call to the listener. This should be the normal case when processing a HTTP request. Maybe some of these call paths can be optimized.

#­57 _BufferingStreamSubscription._sendData.<anonymous closure> (dart:async/stream_impl.dart:184:55)
#­58 _ZoneBase._runInZone (dart:async/zone.dart:82:17)
#­59 _ZoneBase._runGuarded (dart:async/zone.dart:99:22)
#­60 _ZoneBase.executePeriodicCallbackGuarded (dart:async/zone.dart:68:21)
#­61 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:184:41)
#­62 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:135:16)
#­63 _StreamController&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:198:23)
#­64 _StreamController._add (dart:async/stream_controller.dart:130:16)
#­65 _StreamController.add (dart:async/stream_controller.dart:104:9)

@floitschG
Copy link
Contributor

This is a bug-tracker, not stack-overflow. Rewriting the summary.


Changed the title to: "handleMessage in HttpClient goes through too many (zone/async) redirections".

@lrhn
Copy link
Member

lrhn commented May 5, 2014

Removed Type-Defect label.
Added Type-Enhancement, Library-Async labels.

@iposva-google iposva-google added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-async labels May 5, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Feb 29, 2016
@lrhn lrhn added core-m and removed core-m labels Aug 11, 2017
@floitschG floitschG added core-a and removed core-m labels Aug 28, 2017
@natebosch
Copy link
Member

I think we've improved stack traces for async stuff.

Will we reasonably take any action on this? Can it be closed @lrhn ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-a library-async type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants