)]}'
{
  "commit": "e2bf07537848819cc8090d55057e1431f1774aea",
  "tree": "ff9032621a26f4cbc3aa0ad65b6d0f47f8f2f909",
  "parents": [
    "2d603046ebb2676053ddf6cc7697ddf1617a8513"
  ],
  "author": {
    "name": "Valentin Bartenev",
    "email": "vbart@nginx.com",
    "time": "Mon Nov 28 20:58:14 2016 +0300"
  },
  "committer": {
    "name": "Valentin Bartenev",
    "email": "vbart@nginx.com",
    "time": "Mon Nov 28 20:58:14 2016 +0300"
  },
  "message": "HTTP/2: fixed posted streams handling.\n\nA bug was introduced by 82efcedb310b that could lead to timing out of\nresponses or segmentation fault, when accept_mutex was enabled.\n\nThe output queue in HTTP/2 can contain frames from different streams.\nWhen the queue is sent, all related write handlers need to be called.\nIn order to do so, the streams were added to the h2c-\u003eposted queue\nafter handling sent frames.  Then this queue was processed in\nngx_http_v2_write_handler().\n\nIf accept_mutex is enabled, the event\u0027s \"ready\" flag is set but its\nhandler is not called immediately.  Instead, the event is added to\nthe ngx_posted_events queue.  At the same time in this queue can be\nevents from upstream connections.  Such events can result in sending\noutput queue before ngx_http_v2_write_handler() is triggered.  And\nat the time ngx_http_v2_write_handler() is called, the output queue\ncan be already empty with some streams added to h2c-\u003eposted.\n\nBut after 82efcedb310b, these streams weren\u0027t processed if all frames\nhave already been sent and the output queue was empty.  This might lead\nto a situation when a number of streams were get stuck in h2c-\u003eposted\nqueue for a long time.  Eventually these streams might get closed by\nthe send timeout.\n\nIn the worst case this might also lead to a segmentation fault, if\nalready freed stream was left in the h2c-\u003eposted queue.  This could\nhappen if one of the streams was terminated but wasn\u0027t closed, due to\nthe HEADERS frame or a partially sent DATA frame left in the output\nqueue.  If this happened the ngx_http_v2_filter_cleanup() handler\nremoved the stream from the h2c-\u003ewaiting or h2c-\u003eposted queue on\ntermination stage, before the frame has been sent, and the stream\nwas again added to the h2c-\u003eposted queue after the frame was sent.\n\nIn order to fix all these problems and simplify the code, write\nevents of fake stream connections are now added to ngx_posted_events\ninstead of using a custom h2c-\u003eposted queue.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "93f1a6d8e1277ab44c206e21facaf1d877eabec9",
      "old_mode": 33188,
      "old_path": "src/http/v2/ngx_http_v2.c",
      "new_id": "53a9c26e9f2aabb3b003ab97ba78a93be3085166",
      "new_mode": 33188,
      "new_path": "src/http/v2/ngx_http_v2.c"
    },
    {
      "type": "modify",
      "old_id": "2c901d7a257043f634883a53d79892749a0305ae",
      "old_mode": 33188,
      "old_path": "src/http/v2/ngx_http_v2.h",
      "new_id": "2f519e18b6ce4a12ea3530234ad4d2ff99eb8fcb",
      "new_mode": 33188,
      "new_path": "src/http/v2/ngx_http_v2.h"
    },
    {
      "type": "modify",
      "old_id": "09ce3f65e78e9ca1bf8e03244fdd5328cc235854",
      "old_mode": 33188,
      "old_path": "src/http/v2/ngx_http_v2_filter_module.c",
      "new_id": "fa53070c3a3bda8dcc28c95628fd47d2878ec5ce",
      "new_mode": 33188,
      "new_path": "src/http/v2/ngx_http_v2_filter_module.c"
    }
  ]
}
