{"action":"created","issue":{"url":"https://api.github.com/repos/domokit/mojo/issues/555","labels_url":"https://api.github.com/repos/domokit/mojo/issues/555/labels{/name}","comments_url":"https://api.github.com/repos/domokit/mojo/issues/555/comments","events_url":"https://api.github.com/repos/domokit/mojo/issues/555/events","html_url":"https://github.com/domokit/mojo/issues/555","id":118138851,"number":555,"title":"TraceRecorderImpl sometimes doesn't receive the data sent to it","user":{"login":"johnmccutchan","id":224266,"avatar_url":"https://avatars.githubusercontent.com/u/224266?v=3","gravatar_id":"","url":"https://api.github.com/users/johnmccutchan","html_url":"https://github.com/johnmccutchan","followers_url":"https://api.github.com/users/johnmccutchan/followers","following_url":"https://api.github.com/users/johnmccutchan/following{/other_user}","gists_url":"https://api.github.com/users/johnmccutchan/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmccutchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmccutchan/subscriptions","organizations_url":"https://api.github.com/users/johnmccutchan/orgs","repos_url":"https://api.github.com/users/johnmccutchan/repos","events_url":"https://api.github.com/users/johnmccutchan/events{/privacy}","received_events_url":"https://api.github.com/users/johnmccutchan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-20T22:20:33Z","updated_at":"2015-11-21T08:22:59Z","closed_at":null,"body":"My send routine:\r\n\r\n  bool got_trace = Dart_GlobalTimelineGetTrace(AppendStreamConsumer, &data);\r\n  if (got_trace) {\r\n    printf(\"Sending %zu bytes to recorder\\n\", data.size());\r\n    recorder_->Record(reinterpret_cast<char*>(data.data()));\r\n  }\r\n  recorder_.reset();\r\n\r\n\r\nMy debug printf version of TraceRecorderImpl::Record:\r\n\r\nvoid TraceRecorderImpl::Record(const mojo::String& json) {\r\n  printf(\"Received %zu bytes at recorder\\n\", json.size());\r\n  sink_->AddChunk(json.To<std::string>());\r\n}\r\n\r\n\r\n----\r\n\r\nWhen I get lucky and the data arrives:\r\n\r\nReceived 11304 bytes at recorder\r\nReceived 23921 bytes at recorder\r\nDart tracing got 2988355 bytes of trace data.\r\nSending 2988355 bytes to recorder\r\nReceived 2988354 bytes at recorder\r\n[INFO:tracer.cc(114)] Wrote trace data to rtt.trace\r\n\r\n\r\nWhen I get unlucky and the data doesn't arrive:\r\n\r\nReceived 11297 bytes at recorder\r\nReceived 23691 bytes at recorder\r\nDart tracing got 5584056 bytes of trace data.\r\nSending 5584056 bytes to recorder\r\n[INFO:tracer.cc(114)] Wrote trace data to rtt.trace\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/domokit/mojo/issues/comments/158612433","html_url":"https://github.com/domokit/mojo/issues/555#issuecomment-158612433","issue_url":"https://api.github.com/repos/domokit/mojo/issues/555","id":158612433,"user":{"login":"zanderso","id":6343103,"avatar_url":"https://avatars.githubusercontent.com/u/6343103?v=3","gravatar_id":"","url":"https://api.github.com/users/zanderso","html_url":"https://github.com/zanderso","followers_url":"https://api.github.com/users/zanderso/followers","following_url":"https://api.github.com/users/zanderso/following{/other_user}","gists_url":"https://api.github.com/users/zanderso/gists{/gist_id}","starred_url":"https://api.github.com/users/zanderso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanderso/subscriptions","organizations_url":"https://api.github.com/users/zanderso/orgs","repos_url":"https://api.github.com/users/zanderso/repos","events_url":"https://api.github.com/users/zanderso/events{/privacy}","received_events_url":"https://api.github.com/users/zanderso/received_events","type":"User","site_admin":false},"created_at":"2015-11-21T08:22:59Z","updated_at":"2015-11-21T08:22:59Z","body":"I split up the data sent by the DartTraceProvider into chunks. This seems to result in all the data making it to the other side. I also needed to relax the timeout in the tracing app:\r\n\r\nhttps://codereview.chromium.org/1467863002"}}