{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc/pulls/comments/84987768","pull_request_review_id":5730958,"id":84987768,"diff_hunk":"@@ -375,37 +375,43 @@ - (void)startWithWriteable:(id<GRXWriteable>)writeable {\n     _state = GRXWriterStateStarted;\n   }\n \n-  // Create a retain cycle so that this instance lives until the RPC finishes (or is cancelled).\n-  // This makes RPCs in which the call isn't externally retained possible (as long as it is started\n-  // before being autoreleased).\n-  // Care is taken not to retain self strongly in any of the blocks used in this implementation, so\n-  // that the life of the instance is determined by this retain cycle.\n-  _retainSelf = self;\n-\n-  _responseWriteable = [[GRXConcurrentWriteable alloc] initWithWriteable:writeable];\n-\n-  _wrappedCall = [[GRPCWrappedCall alloc] initWithHost:_host path:_path];\n-  NSAssert(_wrappedCall, @\"Error allocating RPC objects. Low memory?\");\n-\n-  [self sendHeaders:_requestHeaders];\n-  [self invokeCall];\n   // TODO(jcanizales): Extract this logic somewhere common.\n   NSString *host = [NSURL URLWithString:[@\"https://\" stringByAppendingString:_host]].host;\n   if (!host) {\n     // TODO(jcanizales): Check this on init.\n     [NSException raise:NSInvalidArgumentException format:@\"host of %@ is nil\", _host];\n   }\n   __weak typeof(self) weakSelf = self;\n-  _connectivityMonitor = [GRPCConnectivityMonitor monitorWithHost:host];\n-  [_connectivityMonitor handleLossWithHandler:^{\n+    _connectivityMonitor = [GRPCConnectivityMonitor monitorWithHost:host];\n+  void (^handler)() = ^{\n     typeof(self) strongSelf = weakSelf;\n     if (strongSelf) {\n       [strongSelf finishWithError:[NSError errorWithDomain:kGRPCErrorDomain\n                                                       code:GRPCErrorCodeUnavailable\n                                                   userInfo:@{NSLocalizedDescriptionKey: @\"Connectivity lost.\"}]];\n-      [[GRPCHost hostWithAddress:strongSelf->_host] disconnect];\n     }\n-  }];\n+  };\n+  [_connectivityMonitor handleLossWithHandler:handler","path":"src/objective-c/GRPCClient/GRPCCall.m","position":38,"original_position":38,"commit_id":"ad93106da012bcd2080d229ab5b6c61dd2f59fed","original_commit_id":"ad93106da012bcd2080d229ab5b6c61dd2f59fed","user":{"login":"muxi","id":1054404,"avatar_url":"https://avatars.githubusercontent.com/u/1054404?v=3","gravatar_id":"","url":"https://api.github.com/users/muxi","html_url":"https://github.com/muxi","followers_url":"https://api.github.com/users/muxi/followers","following_url":"https://api.github.com/users/muxi/following{/other_user}","gists_url":"https://api.github.com/users/muxi/gists{/gist_id}","starred_url":"https://api.github.com/users/muxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muxi/subscriptions","organizations_url":"https://api.github.com/users/muxi/orgs","repos_url":"https://api.github.com/users/muxi/repos","events_url":"https://api.github.com/users/muxi/events{/privacy}","received_events_url":"https://api.github.com/users/muxi/received_events","type":"User","site_admin":false},"body":"yep that's a problem. I'm gonna need to set the monitor earlier than creating the channel","created_at":"2016-10-25T20:00:30Z","updated_at":"2016-10-25T20:00:31Z","html_url":"https://github.com/grpc/grpc/pull/8441#discussion_r84987768","pull_request_url":"https://api.github.com/repos/grpc/grpc/pulls/8441","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments/84987768"},"html":{"href":"https://github.com/grpc/grpc/pull/8441#discussion_r84987768"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc/pulls/8441"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc/pulls/8441","id":90260199,"html_url":"https://github.com/grpc/grpc/pull/8441","diff_url":"https://github.com/grpc/grpc/pull/8441.diff","patch_url":"https://github.com/grpc/grpc/pull/8441.patch","issue_url":"https://api.github.com/repos/grpc/grpc/issues/8441","number":8441,"state":"open","locked":false,"title":"Flush ObjC cached channels when network connectivity changes","user":{"login":"muxi","id":1054404,"avatar_url":"https://avatars.githubusercontent.com/u/1054404?v=3","gravatar_id":"","url":"https://api.github.com/users/muxi","html_url":"https://github.com/muxi","followers_url":"https://api.github.com/users/muxi/followers","following_url":"https://api.github.com/users/muxi/following{/other_user}","gists_url":"https://api.github.com/users/muxi/gists{/gist_id}","starred_url":"https://api.github.com/users/muxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muxi/subscriptions","organizations_url":"https://api.github.com/users/muxi/orgs","repos_url":"https://api.github.com/users/muxi/repos","events_url":"https://api.github.com/users/muxi/events{/privacy}","received_events_url":"https://api.github.com/users/muxi/received_events","type":"User","site_admin":false},"body":"Follow-up of Issue #4064 \r\n\r\ncc: @makdharma ","created_at":"2016-10-20T18:56:43Z","updated_at":"2016-10-25T20:00:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4021dc11c4e144aa4f9fb592c83acb35e4f3fb99","assignee":{"login":"jcanizales","id":5120183,"avatar_url":"https://avatars.githubusercontent.com/u/5120183?v=3","gravatar_id":"","url":"https://api.github.com/users/jcanizales","html_url":"https://github.com/jcanizales","followers_url":"https://api.github.com/users/jcanizales/followers","following_url":"https://api.github.com/users/jcanizales/following{/other_user}","gists_url":"https://api.github.com/users/jcanizales/gists{/gist_id}","starred_url":"https://api.github.com/users/jcanizales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcanizales/subscriptions","organizations_url":"https://api.github.com/users/jcanizales/orgs","repos_url":"https://api.github.com/users/jcanizales/repos","events_url":"https://api.github.com/users/jcanizales/events{/privacy}","received_events_url":"https://api.github.com/users/jcanizales/received_events","type":"User","site_admin":false},"assignees":[{"login":"jcanizales","id":5120183,"avatar_url":"https://avatars.githubusercontent.com/u/5120183?v=3","gravatar_id":"","url":"https://api.github.com/users/jcanizales","html_url":"https://github.com/jcanizales","followers_url":"https://api.github.com/users/jcanizales/followers","following_url":"https://api.github.com/users/jcanizales/following{/other_user}","gists_url":"https://api.github.com/users/jcanizales/gists{/gist_id}","starred_url":"https://api.github.com/users/jcanizales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcanizales/subscriptions","organizations_url":"https://api.github.com/users/jcanizales/orgs","repos_url":"https://api.github.com/users/jcanizales/repos","events_url":"https://api.github.com/users/jcanizales/events{/privacy}","received_events_url":"https://api.github.com/users/jcanizales/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc/pulls/8441/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc/pulls/8441/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/8441/comments","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/ad93106da012bcd2080d229ab5b6c61dd2f59fed","head":{"label":"muxi:update-objc-connectivity","ref":"update-objc-connectivity","sha":"ad93106da012bcd2080d229ab5b6c61dd2f59fed","user":{"login":"muxi","id":1054404,"avatar_url":"https://avatars.githubusercontent.com/u/1054404?v=3","gravatar_id":"","url":"https://api.github.com/users/muxi","html_url":"https://github.com/muxi","followers_url":"https://api.github.com/users/muxi/followers","following_url":"https://api.github.com/users/muxi/following{/other_user}","gists_url":"https://api.github.com/users/muxi/gists{/gist_id}","starred_url":"https://api.github.com/users/muxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muxi/subscriptions","organizations_url":"https://api.github.com/users/muxi/orgs","repos_url":"https://api.github.com/users/muxi/repos","events_url":"https://api.github.com/users/muxi/events{/privacy}","received_events_url":"https://api.github.com/users/muxi/received_events","type":"User","site_admin":false},"repo":{"id":61651647,"name":"grpc","full_name":"muxi/grpc","owner":{"login":"muxi","id":1054404,"avatar_url":"https://avatars.githubusercontent.com/u/1054404?v=3","gravatar_id":"","url":"https://api.github.com/users/muxi","html_url":"https://github.com/muxi","followers_url":"https://api.github.com/users/muxi/followers","following_url":"https://api.github.com/users/muxi/following{/other_user}","gists_url":"https://api.github.com/users/muxi/gists{/gist_id}","starred_url":"https://api.github.com/users/muxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muxi/subscriptions","organizations_url":"https://api.github.com/users/muxi/orgs","repos_url":"https://api.github.com/users/muxi/repos","events_url":"https://api.github.com/users/muxi/events{/privacy}","received_events_url":"https://api.github.com/users/muxi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/muxi/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":true,"url":"https://api.github.com/repos/muxi/grpc","forks_url":"https://api.github.com/repos/muxi/grpc/forks","keys_url":"https://api.github.com/repos/muxi/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/muxi/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/muxi/grpc/teams","hooks_url":"https://api.github.com/repos/muxi/grpc/hooks","issue_events_url":"https://api.github.com/repos/muxi/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/muxi/grpc/events","assignees_url":"https://api.github.com/repos/muxi/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/muxi/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/muxi/grpc/tags","blobs_url":"https://api.github.com/repos/muxi/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/muxi/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/muxi/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/muxi/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/muxi/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/muxi/grpc/languages","stargazers_url":"https://api.github.com/repos/muxi/grpc/stargazers","contributors_url":"https://api.github.com/repos/muxi/grpc/contributors","subscribers_url":"https://api.github.com/repos/muxi/grpc/subscribers","subscription_url":"https://api.github.com/repos/muxi/grpc/subscription","commits_url":"https://api.github.com/repos/muxi/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/muxi/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/muxi/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/muxi/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/muxi/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/muxi/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/muxi/grpc/merges","archive_url":"https://api.github.com/repos/muxi/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/muxi/grpc/downloads","issues_url":"https://api.github.com/repos/muxi/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/muxi/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/muxi/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/muxi/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/muxi/grpc/labels{/name}","releases_url":"https://api.github.com/repos/muxi/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/muxi/grpc/deployments","created_at":"2016-06-21T17:00:36Z","updated_at":"2016-06-21T17:00:46Z","pushed_at":"2016-10-25T00:58:17Z","git_url":"git://github.com/muxi/grpc.git","ssh_url":"git@github.com:muxi/grpc.git","clone_url":"https://github.com/muxi/grpc.git","svn_url":"https://github.com/muxi/grpc","homepage":"","size":84617,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"2bc7b80082912e435fbec7cf40b375b3c15e963e","user":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729880,"name":"grpc","full_name":"grpc/grpc","owner":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":false,"url":"https://api.github.com/repos/grpc/grpc","forks_url":"https://api.github.com/repos/grpc/grpc/forks","keys_url":"https://api.github.com/repos/grpc/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc/teams","hooks_url":"https://api.github.com/repos/grpc/grpc/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc/events","assignees_url":"https://api.github.com/repos/grpc/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc/tags","blobs_url":"https://api.github.com/repos/grpc/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc/subscription","commits_url":"https://api.github.com/repos/grpc/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc/merges","archive_url":"https://api.github.com/repos/grpc/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc/downloads","issues_url":"https://api.github.com/repos/grpc/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/grpc/grpc/deployments","created_at":"2014-12-08T18:58:53Z","updated_at":"2016-10-25T16:37:44Z","pushed_at":"2016-10-25T19:59:53Z","git_url":"git://github.com/grpc/grpc.git","ssh_url":"git@github.com:grpc/grpc.git","clone_url":"https://github.com/grpc/grpc.git","svn_url":"https://github.com/grpc/grpc","homepage":"","size":217575,"stargazers_count":7542,"watchers_count":7542,"language":"C","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":1441,"mirror_url":null,"open_issues_count":851,"forks":1441,"open_issues":851,"watchers":7542,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/8441"},"html":{"href":"https://github.com/grpc/grpc/pull/8441"},"issue":{"href":"https://api.github.com/repos/grpc/grpc/issues/8441"},"comments":{"href":"https://api.github.com/repos/grpc/grpc/issues/8441/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc/pulls/8441/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc/pulls/8441/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc/statuses/ad93106da012bcd2080d229ab5b6c61dd2f59fed"}}}}
{"actor":{"display_login":"muxi"}}