GitHub PullRequestReviewCommentEvent at 2014-06-09 14:24:46
Repository: akka
Actor: ktoso
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/13542611","id":13542611,"diff_hunk":"@@ -23,14 +23,20 @@ trait SyncWriteJournal extends Actor with AsyncRecovery {\n   private val publish = extension.settings.internal.publishPluginCommands\n \n   final def receive = {\n-    case WriteMessages(persistentBatch, processor) ⇒\n-      Try(writeMessages(persistentBatch.map(_.prepareWrite()))) match {\n+    case WriteMessages(resequenceables, processor) ⇒\n+      Try(writeMessages(preparePersistentBatch(resequenceables))) match {\n         case Success(_) ⇒\n           processor ! WriteMessagesSuccessful\n-          persistentBatch.foreach(p ⇒ processor.tell(WriteMessageSuccess(p), p.sender))\n+          resequenceables.foreach {\n+            case p: PersistentRepr ⇒ processor.tell(WriteMessageSuccess(p), p.sender)\n+            case r                 ⇒ processor.tell(LoopMessageSuccess(r.payload), r.sender)\n+          }\n         case Failure(e) ⇒\n           processor ! WriteMessagesFailed(e)\n-          persistentBatch.foreach(p ⇒ processor tell (WriteMessageFailure(p, e), p.sender))\n+          resequenceables.foreach {\n+            case p: PersistentRepr ⇒ processor tell (WriteMessageFailure(p, e), p.sender)\n+            case _                 ⇒ // do nothing, message was not persistent","path":"akka-persistence/src/main/scala/akka/persistence/journal/SyncWriteJournal.scala","position":29,"original_position":29,"commit_id":"ca2bbb8691d9b151c093c375fae64198ab839422","original_commit_id":"acdd910cd9485478c57700b45dc8bc086e0a85ef","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?","gravatar_id":"03cb20b97f6a14701c24c4e088b6af87","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"body":"Docs wise added this:\r\n\r\n```\r\n   * In the event of persistence failures (indicated by [[WriteMessageFailure]] messages being sent to the \r\n   * [[PersistentActor]], you can handle these messages, which in turn will enable the deferred handlers to run afterwards.\r\n   * If persistence failure messages are left `unhandled`, the default behavior is to stop the Actor, thus the handlers\r\n   * will not be run.\r\n```\r\n\r\nNot sure if it's clear enough?","created_at":"2014-06-09T14:24:46Z","updated_at":"2014-06-09T14:24:46Z","html_url":"https://github.com/akka/akka/pull/15339#discussion_r13542611","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/15339","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/13542611"},"html":{"href":"https://github.com/akka/akka/pull/15339#discussion_r13542611"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/15339"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/15339","id":16657763,"html_url":"https://github.com/akka/akka/pull/15339","diff_url":"https://github.com/akka/akka/pull/15339.diff","patch_url":"https://github.com/akka/akka/pull/15339.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/15339","number":15339,"state":"open","title":"+per defer for PersistentActor","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?","gravatar_id":"03cb20b97f6a14701c24c4e088b6af87","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"body":"note: defer does not persist anything (does not even hit the journal). I think this is enough, as if someone wants to persist stuff (get replayable stuff), they can just use persist methods.\r\n\r\nRefs https://github.com/akka/akka/issues/15230\r\nDepends on #15227\r\n\r\nTODO: \r\n- [x] try to implement using same mechanisms as `persistAsync`, remove the 3rd state, make the Journal not persist `LoopStuff` wrapped messages.\r\n- [x] update the persistence lambda docs","created_at":"2014-06-03T14:59:12Z","updated_at":"2014-06-09T14:24:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"514f69221cf6b1c679ac0ae53d929ab06bd978f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/15339/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/15339/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments/{number}","comments_url":"https://api.github.com/repos/akka/akka/issues/15339/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/ca2bbb8691d9b151c093c375fae64198ab839422","head":{"label":"ktoso:per-defer-persistentactor-ktoso","ref":"per-defer-persistentactor-ktoso","sha":"ca2bbb8691d9b151c093c375fae64198ab839422","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?","gravatar_id":"03cb20b97f6a14701c24c4e088b6af87","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"repo":{"id":4462204,"name":"akka","full_name":"ktoso/akka","owner":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?","gravatar_id":"03cb20b97f6a14701c24c4e088b6af87","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ktoso/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/ktoso/akka","forks_url":"https://api.github.com/repos/ktoso/akka/forks","keys_url":"https://api.github.com/repos/ktoso/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ktoso/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ktoso/akka/teams","hooks_url":"https://api.github.com/repos/ktoso/akka/hooks","issue_events_url":"https://api.github.com/repos/ktoso/akka/issues/events{/number}","events_url":"https://api.github.com/repos/ktoso/akka/events","assignees_url":"https://api.github.com/repos/ktoso/akka/assignees{/user}","branches_url":"https://api.github.com/repos/ktoso/akka/branches{/branch}","tags_url":"https://api.github.com/repos/ktoso/akka/tags","blobs_url":"https://api.github.com/repos/ktoso/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ktoso/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ktoso/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/ktoso/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ktoso/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/ktoso/akka/languages","stargazers_url":"https://api.github.com/repos/ktoso/akka/stargazers","contributors_url":"https://api.github.com/repos/ktoso/akka/contributors","subscribers_url":"https://api.github.com/repos/ktoso/akka/subscribers","subscription_url":"https://api.github.com/repos/ktoso/akka/subscription","commits_url":"https://api.github.com/repos/ktoso/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/ktoso/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/ktoso/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/ktoso/akka/issues/comments/{number}","contents_url":"https://api.github.com/repos/ktoso/akka/contents/{+path}","compare_url":"https://api.github.com/repos/ktoso/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ktoso/akka/merges","archive_url":"https://api.github.com/repos/ktoso/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ktoso/akka/downloads","issues_url":"https://api.github.com/repos/ktoso/akka/issues{/number}","pulls_url":"https://api.github.com/repos/ktoso/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/ktoso/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/ktoso/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ktoso/akka/labels{/name}","releases_url":"https://api.github.com/repos/ktoso/akka/releases{/id}","created_at":"2012-05-27T14:05:17Z","updated_at":"2014-06-09T13:36:40Z","pushed_at":"2014-06-09T13:36:39Z","git_url":"git://github.com/ktoso/akka.git","ssh_url":"git@github.com:ktoso/akka.git","clone_url":"https://github.com/ktoso/akka.git","svn_url":"https://github.com/ktoso/akka","homepage":"http://akka.io","size":151972,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"akka:release-2.3","ref":"release-2.3","sha":"b4b3f7853e85ded5b101575673c0c8a7055f3b7f","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?","gravatar_id":"0ff72320fb1bc5db35ba4fae61614eb0","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?","gravatar_id":"0ff72320fb1bc5db35ba4fae61614eb0","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments/{number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","created_at":"2009-02-16T12:51:54Z","updated_at":"2014-06-09T13:51:54Z","pushed_at":"2014-06-09T13:51:53Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":212381,"stargazers_count":2649,"watchers_count":2649,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":711,"mirror_url":null,"open_issues_count":334,"forks":711,"open_issues":334,"watchers":2649,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/15339"},"html":{"href":"https://github.com/akka/akka/pull/15339"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/15339"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/15339/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/15339/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/15339/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/ca2bbb8691d9b151c093c375fae64198ab839422"}}}}