{"action":"created","comment":{"url":"https://api.github.com/repos/ravendb/ravendb/pulls/comments/177641625","pull_request_review_id":107547916,"id":177641625,"diff_hunk":"@@ -917,62 +920,62 @@ internal class NagleData\n             public TaskCompletionSource<BatchResult[]> TaskCompletionSource = new TaskCompletionSource<BatchResult[]>();\n         }\n \n-        private readonly BlockingCollection<NagleData> nagleQueue = new BlockingCollection<NagleData>();\n-        private Task nagleWriterTask;\n+        private readonly ConcurrentDictionary<string, Tuple<Task, BlockingCollection<NagleData>>> nagleTasks = \n+            new ConcurrentDictionary<string, Tuple<Task, BlockingCollection<NagleData>>>();\n \n-        internal Task<BatchResult[]> AddNagleData(InMemoryDocumentSessionOperations.SaveChangesData saveChangesData)\n+        internal Task<BatchResult[]> AddNagleData(string databaseName, InMemoryDocumentSessionOperations.SaveChangesData saveChangesData)\n         {\n-            InitializeNagleQueueWriterIfNeeded();\n+            var nagleQueue = GetNagleQueue(databaseName);\n \n             var nagleData = new NagleData { SaveChangesData = saveChangesData };\n             nagleQueue.Add(nagleData);\n             return nagleData.TaskCompletionSource.Task;\n         }\n \n-        private void InitializeNagleQueueWriterIfNeeded()\n+        private BlockingCollection<NagleData> GetNagleQueue(string databaseName)\n         {\n-         \n-            if (nagleWriterTask != null)\n-            {\n-                EnsureNagleIsNotFaulted();\n-                return;\n-            }\n-\n-            lock (nagleQueue)\n+            var nagle = nagleTasks.GetOrAdd(databaseName ?? \"<system>\", x =>","path":"Raven.Client.Lightweight/Document/DocumentStore.cs","position":45,"original_position":45,"commit_id":"6433eeeafe0e7da95f9443a09a8bdda32e006010","original_commit_id":"6433eeeafe0e7da95f9443a09a8bdda32e006010","user":{"login":"grisha-kotler","id":6964706,"avatar_url":"https://avatars0.githubusercontent.com/u/6964706?v=4","gravatar_id":"","url":"https://api.github.com/users/grisha-kotler","html_url":"https://github.com/grisha-kotler","followers_url":"https://api.github.com/users/grisha-kotler/followers","following_url":"https://api.github.com/users/grisha-kotler/following{/other_user}","gists_url":"https://api.github.com/users/grisha-kotler/gists{/gist_id}","starred_url":"https://api.github.com/users/grisha-kotler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grisha-kotler/subscriptions","organizations_url":"https://api.github.com/users/grisha-kotler/orgs","repos_url":"https://api.github.com/users/grisha-kotler/repos","events_url":"https://api.github.com/users/grisha-kotler/events{/privacy}","received_events_url":"https://api.github.com/users/grisha-kotler/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-03-28T05:27:54Z","updated_at":"2018-03-28T05:27:54Z","html_url":"https://github.com/ravendb/ravendb/pull/5732#discussion_r177641625","pull_request_url":"https://api.github.com/repos/ravendb/ravendb/pulls/5732","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ravendb/ravendb/pulls/comments/177641625"},"html":{"href":"https://github.com/ravendb/ravendb/pull/5732#discussion_r177641625"},"pull_request":{"href":"https://api.github.com/repos/ravendb/ravendb/pulls/5732"}},"in_reply_to_id":177490525},"pull_request":{"url":"https://api.github.com/repos/ravendb/ravendb/pulls/5732","id":177727817,"html_url":"https://github.com/ravendb/ravendb/pull/5732","diff_url":"https://github.com/ravendb/ravendb/pull/5732.diff","patch_url":"https://github.com/ravendb/ravendb/pull/5732.patch","issue_url":"https://api.github.com/repos/ravendb/ravendb/issues/5732","number":5732,"state":"closed","locked":false,"title":"RavenDB-10815 - Nagle session can work against a specified database and not just the default one","user":{"login":"grisha-kotler","id":6964706,"avatar_url":"https://avatars0.githubusercontent.com/u/6964706?v=4","gravatar_id":"","url":"https://api.github.com/users/grisha-kotler","html_url":"https://github.com/grisha-kotler","followers_url":"https://api.github.com/users/grisha-kotler/followers","following_url":"https://api.github.com/users/grisha-kotler/following{/other_user}","gists_url":"https://api.github.com/users/grisha-kotler/gists{/gist_id}","starred_url":"https://api.github.com/users/grisha-kotler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grisha-kotler/subscriptions","organizations_url":"https://api.github.com/users/grisha-kotler/orgs","repos_url":"https://api.github.com/users/grisha-kotler/repos","events_url":"https://api.github.com/users/grisha-kotler/events{/privacy}","received_events_url":"https://api.github.com/users/grisha-kotler/received_events","type":"User","site_admin":false},"body":"http://issues.hibernatingrhinos.com/issue/RavenDB-10815","created_at":"2018-03-27T12:44:23Z","updated_at":"2018-03-28T05:27:54Z","closed_at":"2018-03-27T13:37:46Z","merged_at":"2018-03-27T13:37:46Z","merge_commit_sha":"6ce5b07c4a53b145c11eb9b0f5c3be20e4d13e7f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ravendb/ravendb/pulls/5732/commits","review_comments_url":"https://api.github.com/repos/ravendb/ravendb/pulls/5732/comments","review_comment_url":"https://api.github.com/repos/ravendb/ravendb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ravendb/ravendb/issues/5732/comments","statuses_url":"https://api.github.com/repos/ravendb/ravendb/statuses/6433eeeafe0e7da95f9443a09a8bdda32e006010","head":{"label":"grisha-kotler:RavenDB-10815-fix","ref":"RavenDB-10815-fix","sha":"6433eeeafe0e7da95f9443a09a8bdda32e006010","user":{"login":"grisha-kotler","id":6964706,"avatar_url":"https://avatars0.githubusercontent.com/u/6964706?v=4","gravatar_id":"","url":"https://api.github.com/users/grisha-kotler","html_url":"https://github.com/grisha-kotler","followers_url":"https://api.github.com/users/grisha-kotler/followers","following_url":"https://api.github.com/users/grisha-kotler/following{/other_user}","gists_url":"https://api.github.com/users/grisha-kotler/gists{/gist_id}","starred_url":"https://api.github.com/users/grisha-kotler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grisha-kotler/subscriptions","organizations_url":"https://api.github.com/users/grisha-kotler/orgs","repos_url":"https://api.github.com/users/grisha-kotler/repos","events_url":"https://api.github.com/users/grisha-kotler/events{/privacy}","received_events_url":"https://api.github.com/users/grisha-kotler/received_events","type":"User","site_admin":false},"repo":{"id":17794101,"name":"ravendb","full_name":"grisha-kotler/ravendb","owner":{"login":"grisha-kotler","id":6964706,"avatar_url":"https://avatars0.githubusercontent.com/u/6964706?v=4","gravatar_id":"","url":"https://api.github.com/users/grisha-kotler","html_url":"https://github.com/grisha-kotler","followers_url":"https://api.github.com/users/grisha-kotler/followers","following_url":"https://api.github.com/users/grisha-kotler/following{/other_user}","gists_url":"https://api.github.com/users/grisha-kotler/gists{/gist_id}","starred_url":"https://api.github.com/users/grisha-kotler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grisha-kotler/subscriptions","organizations_url":"https://api.github.com/users/grisha-kotler/orgs","repos_url":"https://api.github.com/users/grisha-kotler/repos","events_url":"https://api.github.com/users/grisha-kotler/events{/privacy}","received_events_url":"https://api.github.com/users/grisha-kotler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grisha-kotler/ravendb","description":"A linq enabled document database for .NET","fork":true,"url":"https://api.github.com/repos/grisha-kotler/ravendb","forks_url":"https://api.github.com/repos/grisha-kotler/ravendb/forks","keys_url":"https://api.github.com/repos/grisha-kotler/ravendb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grisha-kotler/ravendb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grisha-kotler/ravendb/teams","hooks_url":"https://api.github.com/repos/grisha-kotler/ravendb/hooks","issue_events_url":"https://api.github.com/repos/grisha-kotler/ravendb/issues/events{/number}","events_url":"https://api.github.com/repos/grisha-kotler/ravendb/events","assignees_url":"https://api.github.com/repos/grisha-kotler/ravendb/assignees{/user}","branches_url":"https://api.github.com/repos/grisha-kotler/ravendb/branches{/branch}","tags_url":"https://api.github.com/repos/grisha-kotler/ravendb/tags","blobs_url":"https://api.github.com/repos/grisha-kotler/ravendb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grisha-kotler/ravendb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grisha-kotler/ravendb/git/refs{/sha}","trees_url":"https://api.github.com/repos/grisha-kotler/ravendb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grisha-kotler/ravendb/statuses/{sha}","languages_url":"https://api.github.com/repos/grisha-kotler/ravendb/languages","stargazers_url":"https://api.github.com/repos/grisha-kotler/ravendb/stargazers","contributors_url":"https://api.github.com/repos/grisha-kotler/ravendb/contributors","subscribers_url":"https://api.github.com/repos/grisha-kotler/ravendb/subscribers","subscription_url":"https://api.github.com/repos/grisha-kotler/ravendb/subscription","commits_url":"https://api.github.com/repos/grisha-kotler/ravendb/commits{/sha}","git_commits_url":"https://api.github.com/repos/grisha-kotler/ravendb/git/commits{/sha}","comments_url":"https://api.github.com/repos/grisha-kotler/ravendb/comments{/number}","issue_comment_url":"https://api.github.com/repos/grisha-kotler/ravendb/issues/comments{/number}","contents_url":"https://api.github.com/repos/grisha-kotler/ravendb/contents/{+path}","compare_url":"https://api.github.com/repos/grisha-kotler/ravendb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grisha-kotler/ravendb/merges","archive_url":"https://api.github.com/repos/grisha-kotler/ravendb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grisha-kotler/ravendb/downloads","issues_url":"https://api.github.com/repos/grisha-kotler/ravendb/issues{/number}","pulls_url":"https://api.github.com/repos/grisha-kotler/ravendb/pulls{/number}","milestones_url":"https://api.github.com/repos/grisha-kotler/ravendb/milestones{/number}","notifications_url":"https://api.github.com/repos/grisha-kotler/ravendb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grisha-kotler/ravendb/labels{/name}","releases_url":"https://api.github.com/repos/grisha-kotler/ravendb/releases{/id}","deployments_url":"https://api.github.com/repos/grisha-kotler/ravendb/deployments","created_at":"2014-03-16T07:07:13Z","updated_at":"2016-10-19T14:04:55Z","pushed_at":"2018-03-28T05:27:03Z","git_url":"git://github.com/grisha-kotler/ravendb.git","ssh_url":"git@github.com:grisha-kotler/ravendb.git","clone_url":"https://github.com/grisha-kotler/ravendb.git","svn_url":"https://github.com/grisha-kotler/ravendb","homepage":"http://ayende.com/Blog/","size":524546,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ravendb:v3.5","ref":"v3.5","sha":"a33027280486e45f1de741f5e480409ed7f4037a","user":{"login":"ravendb","id":213792,"avatar_url":"https://avatars0.githubusercontent.com/u/213792?v=4","gravatar_id":"","url":"https://api.github.com/users/ravendb","html_url":"https://github.com/ravendb","followers_url":"https://api.github.com/users/ravendb/followers","following_url":"https://api.github.com/users/ravendb/following{/other_user}","gists_url":"https://api.github.com/users/ravendb/gists{/gist_id}","starred_url":"https://api.github.com/users/ravendb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravendb/subscriptions","organizations_url":"https://api.github.com/users/ravendb/orgs","repos_url":"https://api.github.com/users/ravendb/repos","events_url":"https://api.github.com/users/ravendb/events{/privacy}","received_events_url":"https://api.github.com/users/ravendb/received_events","type":"Organization","site_admin":false},"repo":{"id":542714,"name":"ravendb","full_name":"ravendb/ravendb","owner":{"login":"ravendb","id":213792,"avatar_url":"https://avatars0.githubusercontent.com/u/213792?v=4","gravatar_id":"","url":"https://api.github.com/users/ravendb","html_url":"https://github.com/ravendb","followers_url":"https://api.github.com/users/ravendb/followers","following_url":"https://api.github.com/users/ravendb/following{/other_user}","gists_url":"https://api.github.com/users/ravendb/gists{/gist_id}","starred_url":"https://api.github.com/users/ravendb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravendb/subscriptions","organizations_url":"https://api.github.com/users/ravendb/orgs","repos_url":"https://api.github.com/users/ravendb/repos","events_url":"https://api.github.com/users/ravendb/events{/privacy}","received_events_url":"https://api.github.com/users/ravendb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ravendb/ravendb","description":"ACID Document Database","fork":false,"url":"https://api.github.com/repos/ravendb/ravendb","forks_url":"https://api.github.com/repos/ravendb/ravendb/forks","keys_url":"https://api.github.com/repos/ravendb/ravendb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ravendb/ravendb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ravendb/ravendb/teams","hooks_url":"https://api.github.com/repos/ravendb/ravendb/hooks","issue_events_url":"https://api.github.com/repos/ravendb/ravendb/issues/events{/number}","events_url":"https://api.github.com/repos/ravendb/ravendb/events","assignees_url":"https://api.github.com/repos/ravendb/ravendb/assignees{/user}","branches_url":"https://api.github.com/repos/ravendb/ravendb/branches{/branch}","tags_url":"https://api.github.com/repos/ravendb/ravendb/tags","blobs_url":"https://api.github.com/repos/ravendb/ravendb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ravendb/ravendb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ravendb/ravendb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ravendb/ravendb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ravendb/ravendb/statuses/{sha}","languages_url":"https://api.github.com/repos/ravendb/ravendb/languages","stargazers_url":"https://api.github.com/repos/ravendb/ravendb/stargazers","contributors_url":"https://api.github.com/repos/ravendb/ravendb/contributors","subscribers_url":"https://api.github.com/repos/ravendb/ravendb/subscribers","subscription_url":"https://api.github.com/repos/ravendb/ravendb/subscription","commits_url":"https://api.github.com/repos/ravendb/ravendb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ravendb/ravendb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ravendb/ravendb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ravendb/ravendb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ravendb/ravendb/contents/{+path}","compare_url":"https://api.github.com/repos/ravendb/ravendb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ravendb/ravendb/merges","archive_url":"https://api.github.com/repos/ravendb/ravendb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ravendb/ravendb/downloads","issues_url":"https://api.github.com/repos/ravendb/ravendb/issues{/number}","pulls_url":"https://api.github.com/repos/ravendb/ravendb/pulls{/number}","milestones_url":"https://api.github.com/repos/ravendb/ravendb/milestones{/number}","notifications_url":"https://api.github.com/repos/ravendb/ravendb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ravendb/ravendb/labels{/name}","releases_url":"https://api.github.com/repos/ravendb/ravendb/releases{/id}","deployments_url":"https://api.github.com/repos/ravendb/ravendb/deployments","created_at":"2010-03-02T11:05:30Z","updated_at":"2018-03-27T16:33:54Z","pushed_at":"2018-03-28T05:27:37Z","git_url":"git://github.com/ravendb/ravendb.git","ssh_url":"git@github.com:ravendb/ravendb.git","clone_url":"https://github.com/ravendb/ravendb.git","svn_url":"https://github.com/ravendb/ravendb","homepage":"https://ravendb.net","size":433613,"stargazers_count":1876,"watchers_count":1876,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":681,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":681,"open_issues":1,"watchers":1876,"default_branch":"v4.0"}},"_links":{"self":{"href":"https://api.github.com/repos/ravendb/ravendb/pulls/5732"},"html":{"href":"https://github.com/ravendb/ravendb/pull/5732"},"issue":{"href":"https://api.github.com/repos/ravendb/ravendb/issues/5732"},"comments":{"href":"https://api.github.com/repos/ravendb/ravendb/issues/5732/comments"},"review_comments":{"href":"https://api.github.com/repos/ravendb/ravendb/pulls/5732/comments"},"review_comment":{"href":"https://api.github.com/repos/ravendb/ravendb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ravendb/ravendb/pulls/5732/commits"},"statuses":{"href":"https://api.github.com/repos/ravendb/ravendb/statuses/6433eeeafe0e7da95f9443a09a8bdda32e006010"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"grisha-kotler"}}