{"action":"created","comment":{"url":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/comments/210255676","pull_request_review_id":146429724,"id":210255676,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDI1NTY3Ng==","diff_hunk":"@@ -439,65 +447,68 @@ public Response get(@Context HttpHeaders httpHeaders, String json) throws Except\n \t\tcheckNotNull(json);\n \t\tlogger.debug(json);\n \n-\t\tSpan span = createSpan(\"datapoints_query\", httpHeaders);\n+\t\tfinal Span span = createSpan(\"datapoints_query\", httpHeaders);\n+\t\tExecutorService executor = new ThreadPoolExecutor(0,4,0l,TimeUnit.MILLISECONDS, new SynchronousQueue<>(),\n+\t\t\t\tnew ThreadPoolExecutor.AbortPolicy());\n \n \t\ttry (Scope scope = tracer.scopeManager().activate(span, false))\n \t\t{\n+\t\t\tTimeLimiter limiter = new SimpleTimeLimiter(executor);\n+\n \t\t\tFile respFile = File.createTempFile(\"kairos\", \".json\", new File(datastore.getCacheDir()));\n \t\t\tBufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(respFile), \"UTF-8\"));\n-\n \t\t\tJsonResponse jsonResponse = new JsonResponse(writer);\n-\n \t\t\tjsonResponse.begin();\n-\n \t\t\tList<QueryMetric> queries = queryParser.parseQueryMetric(json);\n \n-\t\t\tfor (QueryMetric query : queries)\n-\t\t\t{\n-\t\t\t\tMap<String, Collection<String>> tags = query.getTags().asMap();\n-\t\t\t\tSet<String> keys = tags.keySet();\n-\n-\t\t\t\tspan.setTag(\"metric_name\", query.getName());\n-\n-\t\t\t\tfor (String key : keys) {\n-\t\t\t\t\tStringBuilder str = new StringBuilder();\n-\t\t\t\t\tIterator<String> iter = tags.get(key).iterator();\n-\t\t\t\t\twhile(iter.hasNext()) {\n-\t\t\t\t\t\tstr.append(iter.next() + \",\");\n-\t\t\t\t\t}\n-\t\t\t\t\tstr.deleteCharAt(str.lastIndexOf(\",\"));\n-\t\t\t\t\tspan.setTag(key, str.toString());\n-\t\t\t\t}\n-\n-\t\t\t\tqueryMeasurementProvider.measureSpanForMetric(query);\n-\t\t\t\tqueryMeasurementProvider.measureDistanceForMetric(query);\n-\n-\t\t\t\tDatastoreQuery dq = datastore.createQuery(query);\n-\t\t\t\ttry {\n-\t\t\t\t\tList<DataPointGroup> results = dq.execute();\n-\t\t\t\t\tjsonResponse.formatQuery(results, query.isExcludeTags(), dq.getSampleSize());\n-\t\t\t\t} catch (Throwable e) {\n-\t\t\t\t\tqueryMeasurementProvider.measureSpanError(query);\n-\t\t\t\t\tqueryMeasurementProvider.measureDistanceError(query);\n-\t\t\t\t\tthrow e;\n-\t\t\t\t}\n-\t\t\t\tfinally\n-\t\t\t\t{\n-\t\t\t\t\tqueryMeasurementProvider.measureSpanSuccess(query);\n-\t\t\t\t\tqueryMeasurementProvider.measureDistanceSuccess(query);\n-\t\t\t\t\tdq.close();\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tjsonResponse.end();\n-\t\t\twriter.flush();\n-\t\t\twriter.close();\n-\n-\t\t\tResponseBuilder responseBuilder = Response.status(Response.Status.OK).entity(\n-\t\t\t\t\tnew FileStreamingOutput(respFile));\n-\n-\t\t\tsetHeaders(responseBuilder);\n-\t\t\treturn responseBuilder.build();\n+            return limiter.callWithTimeout(()->{","path":"src/main/java/org/kairosdb/core/http/rest/MetricsResource.java","position":107,"original_position":107,"commit_id":"38d52fb765ea3e146a608a6f9bdc098f114eb22e","original_commit_id":"910dc3cfbb04bf2e050e3e7553ffc47a5bf54fcc","user":{"login":"rajatparida86","id":11991018,"node_id":"MDQ6VXNlcjExOTkxMDE4","avatar_url":"https://avatars0.githubusercontent.com/u/11991018?v=4","gravatar_id":"","url":"https://api.github.com/users/rajatparida86","html_url":"https://github.com/rajatparida86","followers_url":"https://api.github.com/users/rajatparida86/followers","following_url":"https://api.github.com/users/rajatparida86/following{/other_user}","gists_url":"https://api.github.com/users/rajatparida86/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatparida86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatparida86/subscriptions","organizations_url":"https://api.github.com/users/rajatparida86/orgs","repos_url":"https://api.github.com/users/rajatparida86/repos","events_url":"https://api.github.com/users/rajatparida86/events{/privacy}","received_events_url":"https://api.github.com/users/rajatparida86/received_events","type":"User","site_admin":false},"body":"this timeout is not meant for the cassandra queries...but for the entire response creation process\r\n","created_at":"2018-08-15T12:44:32Z","updated_at":"2018-08-15T12:44:32Z","html_url":"https://github.com/zalando-zmon/kairosdb/pull/57#discussion_r210255676","pull_request_url":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/57","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/comments/210255676"},"html":{"href":"https://github.com/zalando-zmon/kairosdb/pull/57#discussion_r210255676"},"pull_request":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/57"}},"in_reply_to_id":210254569},"pull_request":{"url":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/57","id":206474604,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NDc0NjA0","html_url":"https://github.com/zalando-zmon/kairosdb/pull/57","diff_url":"https://github.com/zalando-zmon/kairosdb/pull/57.diff","patch_url":"https://github.com/zalando-zmon/kairosdb/pull/57.patch","issue_url":"https://api.github.com/repos/zalando-zmon/kairosdb/issues/57","number":57,"state":"open","locked":false,"title":"Added timeout for datapoints query","user":{"login":"rajatparida86","id":11991018,"node_id":"MDQ6VXNlcjExOTkxMDE4","avatar_url":"https://avatars0.githubusercontent.com/u/11991018?v=4","gravatar_id":"","url":"https://api.github.com/users/rajatparida86","html_url":"https://github.com/rajatparida86","followers_url":"https://api.github.com/users/rajatparida86/followers","following_url":"https://api.github.com/users/rajatparida86/following{/other_user}","gists_url":"https://api.github.com/users/rajatparida86/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatparida86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatparida86/subscriptions","organizations_url":"https://api.github.com/users/rajatparida86/orgs","repos_url":"https://api.github.com/users/rajatparida86/repos","events_url":"https://api.github.com/users/rajatparida86/events{/privacy}","received_events_url":"https://api.github.com/users/rajatparida86/received_events","type":"User","site_admin":false},"body":"Added timeout for datapoints query","created_at":"2018-08-06T18:04:49Z","updated_at":"2018-08-15T12:44:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03145fd119f1e703e63a26211cd07e721bd6478a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1013746985,"node_id":"MDU6TGFiZWwxMDEzNzQ2OTg1","url":"https://api.github.com/repos/zalando-zmon/kairosdb/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/57/commits","review_comments_url":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/57/comments","review_comment_url":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zalando-zmon/kairosdb/issues/57/comments","statuses_url":"https://api.github.com/repos/zalando-zmon/kairosdb/statuses/38d52fb765ea3e146a608a6f9bdc098f114eb22e","head":{"label":"zalando-zmon:cassandra_query_timeout","ref":"cassandra_query_timeout","sha":"38d52fb765ea3e146a608a6f9bdc098f114eb22e","user":{"login":"zalando-zmon","id":19532842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTMyODQy","avatar_url":"https://avatars3.githubusercontent.com/u/19532842?v=4","gravatar_id":"","url":"https://api.github.com/users/zalando-zmon","html_url":"https://github.com/zalando-zmon","followers_url":"https://api.github.com/users/zalando-zmon/followers","following_url":"https://api.github.com/users/zalando-zmon/following{/other_user}","gists_url":"https://api.github.com/users/zalando-zmon/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando-zmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando-zmon/subscriptions","organizations_url":"https://api.github.com/users/zalando-zmon/orgs","repos_url":"https://api.github.com/users/zalando-zmon/repos","events_url":"https://api.github.com/users/zalando-zmon/events{/privacy}","received_events_url":"https://api.github.com/users/zalando-zmon/received_events","type":"Organization","site_admin":false},"repo":{"id":60760954,"node_id":"MDEwOlJlcG9zaXRvcnk2MDc2MDk1NA==","name":"kairosdb","full_name":"zalando-zmon/kairosdb","owner":{"login":"zalando-zmon","id":19532842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTMyODQy","avatar_url":"https://avatars3.githubusercontent.com/u/19532842?v=4","gravatar_id":"","url":"https://api.github.com/users/zalando-zmon","html_url":"https://github.com/zalando-zmon","followers_url":"https://api.github.com/users/zalando-zmon/followers","following_url":"https://api.github.com/users/zalando-zmon/following{/other_user}","gists_url":"https://api.github.com/users/zalando-zmon/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando-zmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando-zmon/subscriptions","organizations_url":"https://api.github.com/users/zalando-zmon/orgs","repos_url":"https://api.github.com/users/zalando-zmon/repos","events_url":"https://api.github.com/users/zalando-zmon/events{/privacy}","received_events_url":"https://api.github.com/users/zalando-zmon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando-zmon/kairosdb","description":"Fast scalable time series database","fork":true,"url":"https://api.github.com/repos/zalando-zmon/kairosdb","forks_url":"https://api.github.com/repos/zalando-zmon/kairosdb/forks","keys_url":"https://api.github.com/repos/zalando-zmon/kairosdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando-zmon/kairosdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando-zmon/kairosdb/teams","hooks_url":"https://api.github.com/repos/zalando-zmon/kairosdb/hooks","issue_events_url":"https://api.github.com/repos/zalando-zmon/kairosdb/issues/events{/number}","events_url":"https://api.github.com/repos/zalando-zmon/kairosdb/events","assignees_url":"https://api.github.com/repos/zalando-zmon/kairosdb/assignees{/user}","branches_url":"https://api.github.com/repos/zalando-zmon/kairosdb/branches{/branch}","tags_url":"https://api.github.com/repos/zalando-zmon/kairosdb/tags","blobs_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando-zmon/kairosdb/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando-zmon/kairosdb/languages","stargazers_url":"https://api.github.com/repos/zalando-zmon/kairosdb/stargazers","contributors_url":"https://api.github.com/repos/zalando-zmon/kairosdb/contributors","subscribers_url":"https://api.github.com/repos/zalando-zmon/kairosdb/subscribers","subscription_url":"https://api.github.com/repos/zalando-zmon/kairosdb/subscription","commits_url":"https://api.github.com/repos/zalando-zmon/kairosdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando-zmon/kairosdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando-zmon/kairosdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando-zmon/kairosdb/contents/{+path}","compare_url":"https://api.github.com/repos/zalando-zmon/kairosdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando-zmon/kairosdb/merges","archive_url":"https://api.github.com/repos/zalando-zmon/kairosdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando-zmon/kairosdb/downloads","issues_url":"https://api.github.com/repos/zalando-zmon/kairosdb/issues{/number}","pulls_url":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando-zmon/kairosdb/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando-zmon/kairosdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando-zmon/kairosdb/labels{/name}","releases_url":"https://api.github.com/repos/zalando-zmon/kairosdb/releases{/id}","deployments_url":"https://api.github.com/repos/zalando-zmon/kairosdb/deployments","created_at":"2016-06-09T08:44:12Z","updated_at":"2018-08-07T07:44:38Z","pushed_at":"2018-08-15T12:43:44Z","git_url":"git://github.com/zalando-zmon/kairosdb.git","ssh_url":"git@github.com:zalando-zmon/kairosdb.git","clone_url":"https://github.com/zalando-zmon/kairosdb.git","svn_url":"https://github.com/zalando-zmon/kairosdb","homepage":"","size":44718,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":5,"watchers":2,"default_branch":"zalando-kairosdb"}},"base":{"label":"zalando-zmon:zalando-kairosdb","ref":"zalando-kairosdb","sha":"e66660055e017881c517b0972b57b02db0bc2a00","user":{"login":"zalando-zmon","id":19532842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTMyODQy","avatar_url":"https://avatars3.githubusercontent.com/u/19532842?v=4","gravatar_id":"","url":"https://api.github.com/users/zalando-zmon","html_url":"https://github.com/zalando-zmon","followers_url":"https://api.github.com/users/zalando-zmon/followers","following_url":"https://api.github.com/users/zalando-zmon/following{/other_user}","gists_url":"https://api.github.com/users/zalando-zmon/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando-zmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando-zmon/subscriptions","organizations_url":"https://api.github.com/users/zalando-zmon/orgs","repos_url":"https://api.github.com/users/zalando-zmon/repos","events_url":"https://api.github.com/users/zalando-zmon/events{/privacy}","received_events_url":"https://api.github.com/users/zalando-zmon/received_events","type":"Organization","site_admin":false},"repo":{"id":60760954,"node_id":"MDEwOlJlcG9zaXRvcnk2MDc2MDk1NA==","name":"kairosdb","full_name":"zalando-zmon/kairosdb","owner":{"login":"zalando-zmon","id":19532842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTMyODQy","avatar_url":"https://avatars3.githubusercontent.com/u/19532842?v=4","gravatar_id":"","url":"https://api.github.com/users/zalando-zmon","html_url":"https://github.com/zalando-zmon","followers_url":"https://api.github.com/users/zalando-zmon/followers","following_url":"https://api.github.com/users/zalando-zmon/following{/other_user}","gists_url":"https://api.github.com/users/zalando-zmon/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando-zmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando-zmon/subscriptions","organizations_url":"https://api.github.com/users/zalando-zmon/orgs","repos_url":"https://api.github.com/users/zalando-zmon/repos","events_url":"https://api.github.com/users/zalando-zmon/events{/privacy}","received_events_url":"https://api.github.com/users/zalando-zmon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando-zmon/kairosdb","description":"Fast scalable time series database","fork":true,"url":"https://api.github.com/repos/zalando-zmon/kairosdb","forks_url":"https://api.github.com/repos/zalando-zmon/kairosdb/forks","keys_url":"https://api.github.com/repos/zalando-zmon/kairosdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando-zmon/kairosdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando-zmon/kairosdb/teams","hooks_url":"https://api.github.com/repos/zalando-zmon/kairosdb/hooks","issue_events_url":"https://api.github.com/repos/zalando-zmon/kairosdb/issues/events{/number}","events_url":"https://api.github.com/repos/zalando-zmon/kairosdb/events","assignees_url":"https://api.github.com/repos/zalando-zmon/kairosdb/assignees{/user}","branches_url":"https://api.github.com/repos/zalando-zmon/kairosdb/branches{/branch}","tags_url":"https://api.github.com/repos/zalando-zmon/kairosdb/tags","blobs_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando-zmon/kairosdb/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando-zmon/kairosdb/languages","stargazers_url":"https://api.github.com/repos/zalando-zmon/kairosdb/stargazers","contributors_url":"https://api.github.com/repos/zalando-zmon/kairosdb/contributors","subscribers_url":"https://api.github.com/repos/zalando-zmon/kairosdb/subscribers","subscription_url":"https://api.github.com/repos/zalando-zmon/kairosdb/subscription","commits_url":"https://api.github.com/repos/zalando-zmon/kairosdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando-zmon/kairosdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando-zmon/kairosdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando-zmon/kairosdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando-zmon/kairosdb/contents/{+path}","compare_url":"https://api.github.com/repos/zalando-zmon/kairosdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando-zmon/kairosdb/merges","archive_url":"https://api.github.com/repos/zalando-zmon/kairosdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando-zmon/kairosdb/downloads","issues_url":"https://api.github.com/repos/zalando-zmon/kairosdb/issues{/number}","pulls_url":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando-zmon/kairosdb/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando-zmon/kairosdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando-zmon/kairosdb/labels{/name}","releases_url":"https://api.github.com/repos/zalando-zmon/kairosdb/releases{/id}","deployments_url":"https://api.github.com/repos/zalando-zmon/kairosdb/deployments","created_at":"2016-06-09T08:44:12Z","updated_at":"2018-08-07T07:44:38Z","pushed_at":"2018-08-15T12:43:44Z","git_url":"git://github.com/zalando-zmon/kairosdb.git","ssh_url":"git@github.com:zalando-zmon/kairosdb.git","clone_url":"https://github.com/zalando-zmon/kairosdb.git","svn_url":"https://github.com/zalando-zmon/kairosdb","homepage":"","size":44718,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":5,"watchers":2,"default_branch":"zalando-kairosdb"}},"_links":{"self":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/57"},"html":{"href":"https://github.com/zalando-zmon/kairosdb/pull/57"},"issue":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/issues/57"},"comments":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/zalando-zmon/kairosdb/statuses/38d52fb765ea3e146a608a6f9bdc098f114eb22e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rajatparida86"}}