)]}'
{
  "commit": "471bb6f1d98507746627d33620cfb8f1d6f4bd74",
  "tree": "bbc1ebc7d18a221cb95e91e4a12b302f2247883d",
  "parents": [
    "b28f5c26d16a516068435394fadfbbedb97a5cf3"
  ],
  "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": "485f735d9d0298a287a0bf04b4e57d0ec5abfa75",
      "old_mode": 33188,
      "old_path": "src/http/v2/ngx_http_v2.c",
      "new_id": "b9ebcd8ce57daaaa78a1d16061b5f0460feed79a",
      "new_mode": 33188,
      "new_path": "src/http/v2/ngx_http_v2.c"
    },
    {
      "type": "modify",
      "old_id": "63bbdad54857138737585788afc8b2e22c5aa145",
      "old_mode": 33188,
      "old_path": "src/http/v2/ngx_http_v2.h",
      "new_id": "cddfccd287f181282c4fa7eb68dd7db38cdf7226",
      "new_mode": 33188,
      "new_path": "src/http/v2/ngx_http_v2.h"
    },
    {
      "type": "modify",
      "old_id": "878020e5a0b4e2f3d17efdc84f4838abc51bdc40",
      "old_mode": 33188,
      "old_path": "src/http/v2/ngx_http_v2_filter_module.c",
      "new_id": "8abca4dd28dfd192faecd8a59423b0417fa0c567",
      "new_mode": 33188,
      "new_path": "src/http/v2/ngx_http_v2_filter_module.c"
    }
  ]
}
