{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/logstash/pulls/comments/44948173","id":44948173,"diff_hunk":"@@ -59,14 +59,32 @@ def ready?\n   end\n \n   def configure(setting, value)\n-    if setting == \"filter-workers\" && value > 1\n-      # Abort if we have any filters that aren't threadsafe\n-      plugins = @filters.select { |f| !f.threadsafe? }.collect { |f| f.class.config_name }\n-      if !plugins.size.zero?\n-        raise LogStash::ConfigurationError, \"Cannot use more than 1 filter worker because the following plugins don't work with more than one worker: #{plugins.join(\", \")}\"\n+    @settings[setting] = value\n+  end\n+\n+  def safe_filter_worker_count\n+    default = @settings[\"default-filter-workers\"]\n+    thread_count = @settings[\"filter-workers\"] #override from args \"-w 8\" or config\n+    safe_filters, unsafe_filters = @filters.partition(&:threadsafe?)","path":"lib/logstash/pipeline.rb","position":24,"original_position":24,"commit_id":"ad9a99d478879a6488978af26a785089c63c3b7b","original_commit_id":"ad9a99d478879a6488978af26a785089c63c3b7b","user":{"login":"guyboertje","id":84912,"avatar_url":"https://avatars.githubusercontent.com/u/84912?v=3","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"body":"OK.","created_at":"2015-11-16T16:46:25Z","updated_at":"2015-11-16T16:46:25Z","html_url":"https://github.com/elastic/logstash/pull/4156#discussion_r44948173","pull_request_url":"https://api.github.com/repos/elastic/logstash/pulls/4156","_links":{"self":{"href":"https://api.github.com/repos/elastic/logstash/pulls/comments/44948173"},"html":{"href":"https://github.com/elastic/logstash/pull/4156#discussion_r44948173"},"pull_request":{"href":"https://api.github.com/repos/elastic/logstash/pulls/4156"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/logstash/pulls/4156","id":50127817,"html_url":"https://github.com/elastic/logstash/pull/4156","diff_url":"https://github.com/elastic/logstash/pull/4156.diff","patch_url":"https://github.com/elastic/logstash/pull/4156.patch","issue_url":"https://api.github.com/repos/elastic/logstash/issues/4156","number":4156,"state":"open","locked":false,"title":"Add provision for worker threads based on threadsafe workers","user":{"login":"guyboertje","id":84912,"avatar_url":"https://avatars.githubusercontent.com/u/84912?v=3","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"body":"**Notes to reviewers:**\r\n- Allow the default to be set as a function of cores without checking thread safety of filters. \r\n- Allow the command line setting of `-w 6` without checking as above.\r\n- Move the check and alteration of thread_count into the `start_filters` because this allows for dynamic changes to the config. Before, it was only checked at pipeline start.\r\n\r\nFixes #4130","created_at":"2015-11-09T14:24:45Z","updated_at":"2015-11-16T16:46:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68eeba94b92094992b78b80fad0470208c75ce22","assignee":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elastic/logstash/pulls/4156/commits","review_comments_url":"https://api.github.com/repos/elastic/logstash/pulls/4156/comments","review_comment_url":"https://api.github.com/repos/elastic/logstash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/4156/comments","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/ad9a99d478879a6488978af26a785089c63c3b7b","head":{"label":"guyboertje:fix/4130","ref":"fix/4130","sha":"ad9a99d478879a6488978af26a785089c63c3b7b","user":{"login":"guyboertje","id":84912,"avatar_url":"https://avatars.githubusercontent.com/u/84912?v=3","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"repo":{"id":44548170,"name":"logstash","full_name":"guyboertje/logstash","owner":{"login":"guyboertje","id":84912,"avatar_url":"https://avatars.githubusercontent.com/u/84912?v=3","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guyboertje/logstash","description":"logstash - transport and process your logs, events, or other data","fork":true,"url":"https://api.github.com/repos/guyboertje/logstash","forks_url":"https://api.github.com/repos/guyboertje/logstash/forks","keys_url":"https://api.github.com/repos/guyboertje/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guyboertje/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guyboertje/logstash/teams","hooks_url":"https://api.github.com/repos/guyboertje/logstash/hooks","issue_events_url":"https://api.github.com/repos/guyboertje/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/guyboertje/logstash/events","assignees_url":"https://api.github.com/repos/guyboertje/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/guyboertje/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/guyboertje/logstash/tags","blobs_url":"https://api.github.com/repos/guyboertje/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guyboertje/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guyboertje/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/guyboertje/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guyboertje/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/guyboertje/logstash/languages","stargazers_url":"https://api.github.com/repos/guyboertje/logstash/stargazers","contributors_url":"https://api.github.com/repos/guyboertje/logstash/contributors","subscribers_url":"https://api.github.com/repos/guyboertje/logstash/subscribers","subscription_url":"https://api.github.com/repos/guyboertje/logstash/subscription","commits_url":"https://api.github.com/repos/guyboertje/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/guyboertje/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/guyboertje/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/guyboertje/logstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/guyboertje/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/guyboertje/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guyboertje/logstash/merges","archive_url":"https://api.github.com/repos/guyboertje/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guyboertje/logstash/downloads","issues_url":"https://api.github.com/repos/guyboertje/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/guyboertje/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/guyboertje/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/guyboertje/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guyboertje/logstash/labels{/name}","releases_url":"https://api.github.com/repos/guyboertje/logstash/releases{/id}","created_at":"2015-10-19T16:26:52Z","updated_at":"2015-10-19T16:26:56Z","pushed_at":"2015-11-16T13:33:17Z","git_url":"git://github.com/guyboertje/logstash.git","ssh_url":"git@github.com:guyboertje/logstash.git","clone_url":"https://github.com/guyboertje/logstash.git","svn_url":"https://github.com/guyboertje/logstash","homepage":"https://www.elastic.co/products/logstash","size":73491,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"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":"elastic:master","ref":"master","sha":"365cc40c631074230204d722343b353e9db1293e","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":1090311,"name":"logstash","full_name":"elastic/logstash","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/logstash","description":"logstash - transport and process your logs, events, or other data","fork":false,"url":"https://api.github.com/repos/elastic/logstash","forks_url":"https://api.github.com/repos/elastic/logstash/forks","keys_url":"https://api.github.com/repos/elastic/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/logstash/teams","hooks_url":"https://api.github.com/repos/elastic/logstash/hooks","issue_events_url":"https://api.github.com/repos/elastic/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/logstash/events","assignees_url":"https://api.github.com/repos/elastic/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/logstash/tags","blobs_url":"https://api.github.com/repos/elastic/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/logstash/languages","stargazers_url":"https://api.github.com/repos/elastic/logstash/stargazers","contributors_url":"https://api.github.com/repos/elastic/logstash/contributors","subscribers_url":"https://api.github.com/repos/elastic/logstash/subscribers","subscription_url":"https://api.github.com/repos/elastic/logstash/subscription","commits_url":"https://api.github.com/repos/elastic/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/logstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/logstash/merges","archive_url":"https://api.github.com/repos/elastic/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/logstash/downloads","issues_url":"https://api.github.com/repos/elastic/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/logstash/labels{/name}","releases_url":"https://api.github.com/repos/elastic/logstash/releases{/id}","created_at":"2010-11-18T01:31:50Z","updated_at":"2015-11-16T15:50:58Z","pushed_at":"2015-11-16T16:38:57Z","git_url":"git://github.com/elastic/logstash.git","ssh_url":"git@github.com:elastic/logstash.git","clone_url":"https://github.com/elastic/logstash.git","svn_url":"https://github.com/elastic/logstash","homepage":"https://www.elastic.co/products/logstash","size":95253,"stargazers_count":5015,"watchers_count":5015,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1621,"mirror_url":null,"open_issues_count":657,"forks":1621,"open_issues":657,"watchers":5015,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/logstash/pulls/4156"},"html":{"href":"https://github.com/elastic/logstash/pull/4156"},"issue":{"href":"https://api.github.com/repos/elastic/logstash/issues/4156"},"comments":{"href":"https://api.github.com/repos/elastic/logstash/issues/4156/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/logstash/pulls/4156/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/logstash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/logstash/pulls/4156/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/logstash/statuses/ad9a99d478879a6488978af26a785089c63c3b7b"}}}}