{"action":"created","issue":{"url":"https://api.github.com/repos/graphite-project/graphite-web/issues/1278","labels_url":"https://api.github.com/repos/graphite-project/graphite-web/issues/1278/labels{/name}","comments_url":"https://api.github.com/repos/graphite-project/graphite-web/issues/1278/comments","events_url":"https://api.github.com/repos/graphite-project/graphite-web/issues/1278/events","html_url":"https://github.com/graphite-project/graphite-web/issues/1278","id":94884845,"number":1278,"title":"Clustered webapp race condition writing [] to memcache","user":{"login":"apg-pk","id":3698069,"avatar_url":"https://avatars.githubusercontent.com/u/3698069?v=3","gravatar_id":"","url":"https://api.github.com/users/apg-pk","html_url":"https://github.com/apg-pk","followers_url":"https://api.github.com/users/apg-pk/followers","following_url":"https://api.github.com/users/apg-pk/following{/other_user}","gists_url":"https://api.github.com/users/apg-pk/gists{/gist_id}","starred_url":"https://api.github.com/users/apg-pk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apg-pk/subscriptions","organizations_url":"https://api.github.com/users/apg-pk/orgs","repos_url":"https://api.github.com/users/apg-pk/repos","events_url":"https://api.github.com/users/apg-pk/events{/privacy}","received_events_url":"https://api.github.com/users/apg-pk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-14T07:29:27Z","updated_at":"2015-07-14T08:31:42Z","closed_at":null,"body":"Using Graphite 0.9.13 in a 3 node cluster, on initial cache miss for a render request, the correct datapoints are returned, but subsequent requests return an empty array []:\r\n\r\n```bash\r\n$ curl \"0/render/?salt=1436735833.313&target=servers.cmgm004.GenericJMX-QPID-CLIENT-consumerCount.gauge-Count&format=json&from=-1min\"\r\n[{\"target\": \"servers.cmgm004.GenericJMX-QPID-CLIENT-consumerCount.gauge-Count\", \"datapoints\": [[12.0, 1436767950], [12.0, 1436767960], [12.0, 1436767970], [12.0, 1436767980], [12.0, 1436767990], [null, 1436768000]]}]\r\n\r\n$ curl \"0/render/?salt=1436735833.313&target=servers.cmgm004.GenericJMX-QPID-CLIENT-consumerCount.gauge-Count&format=json&from=-1min\"\r\n[]\r\n\r\n$ curl \"0/render/?salt=1436735833.313&target=servers.cmgm004.GenericJMX-QPID-CLIENT-consumerCount.gauge-Count&format=json&from=-1min\"\r\n[]\r\n```\r\n\r\nUsing noCache query param or turning off memcached appear to be workarounds.\r\n\r\nProblem appears to be in: https://github.com/graphite-project/graphite-web/blob/0.9.13-pre1/webapp/graphite/render/views.py#L126-L127\r\n\r\n```python\r\n     for target in targets:\r\n        t = time()\r\n        seriesList = evaluateTarget(requestContext, target)\r\n        log.rendering(\"Retrieval of %s took %.6f\" % (target, time() - t))\r\n        data.extend(seriesList)\r\n\r\n      if useCache:\r\n        cache.add(dataKey, data, cacheTimeout)\r\n```\r\n\r\nIf **data** is never populated for any of the targets (because no metrics are on current node), then **data** will stay initialized to **[]** and then added to cache for subsequent requests to get.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/graphite-project/graphite-web/issues/comments/121166121","html_url":"https://github.com/graphite-project/graphite-web/issues/1278#issuecomment-121166121","issue_url":"https://api.github.com/repos/graphite-project/graphite-web/issues/1278","id":121166121,"user":{"login":"deniszh","id":1227222,"avatar_url":"https://avatars.githubusercontent.com/u/1227222?v=3","gravatar_id":"","url":"https://api.github.com/users/deniszh","html_url":"https://github.com/deniszh","followers_url":"https://api.github.com/users/deniszh/followers","following_url":"https://api.github.com/users/deniszh/following{/other_user}","gists_url":"https://api.github.com/users/deniszh/gists{/gist_id}","starred_url":"https://api.github.com/users/deniszh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deniszh/subscriptions","organizations_url":"https://api.github.com/users/deniszh/orgs","repos_url":"https://api.github.com/users/deniszh/repos","events_url":"https://api.github.com/users/deniszh/events{/privacy}","received_events_url":"https://api.github.com/users/deniszh/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T08:31:42Z","updated_at":"2015-07-14T08:31:42Z","body":"Adding empty list to cache is harmless btw, just turn off shared memcached. "}}