{"action":"opened","number":87,"pull_request":{"url":"https://api.github.com/repos/mirage/ocaml-9p/pulls/87","id":77119136,"html_url":"https://github.com/mirage/ocaml-9p/pull/87","diff_url":"https://github.com/mirage/ocaml-9p/pull/87.diff","patch_url":"https://github.com/mirage/ocaml-9p/pull/87.patch","issue_url":"https://api.github.com/repos/mirage/ocaml-9p/issues/87","number":87,"state":"open","locked":false,"title":"server: fix deadlock when read returns `Eof","user":{"login":"djs55","id":198586,"avatar_url":"https://avatars.githubusercontent.com/u/198586?v=3","gravatar_id":"","url":"https://api.github.com/users/djs55","html_url":"https://github.com/djs55","followers_url":"https://api.github.com/users/djs55/followers","following_url":"https://api.github.com/users/djs55/following{/other_user}","gists_url":"https://api.github.com/users/djs55/gists{/gist_id}","starred_url":"https://api.github.com/users/djs55/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djs55/subscriptions","organizations_url":"https://api.github.com/users/djs55/orgs","repos_url":"https://api.github.com/users/djs55/repos","events_url":"https://api.github.com/users/djs55/events{/privacy}","received_events_url":"https://api.github.com/users/djs55/received_events","type":"User","site_admin":false},"body":"Previously the dispatcher loop would handle the Eof by calling\r\n\r\n  let rec dispatcher_t ... =\r\n    ...\r\n    | Error (`Msg message) ->\r\n      debug (fun f -> f \"S error reading: %s\" message);\r\n      debug (fun f -> f \"Disconnecting client\");\r\n      disconnect ()\r\n      >>= fun () ->\r\n\r\nwhere `disconnect` would set the flag and block:\r\n\r\n  let disconnect () =\r\n    t.please_shutdown <- true;\r\n    t.shutdown_complete_t\r\n\r\nUnfortunately it is the next cycle of the dispatcher which runs\r\n\r\n  let rec dispatcher_t ... =\r\n    if t.please_shutdown then begin\r\n      Lwt.wakeup_later shutdown_complete_wakener ();\r\n\r\nSo before this patch the dispatcher would deadlock. This patch makes\r\nthe dispatcher set the flag only, execute the next cycle, call wakeup_later\r\nand return. This allows the surrounding application to call `after_shutdown`\r\nand then to close the flow.\r\n\r\nSigned-off-by: David Scott <dave@recoil.org>","created_at":"2016-07-12T13:24:16Z","updated_at":"2016-07-12T13:24:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mirage/ocaml-9p/pulls/87/commits","review_comments_url":"https://api.github.com/repos/mirage/ocaml-9p/pulls/87/comments","review_comment_url":"https://api.github.com/repos/mirage/ocaml-9p/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mirage/ocaml-9p/issues/87/comments","statuses_url":"https://api.github.com/repos/mirage/ocaml-9p/statuses/c4c9c78dd6f81522d6cebbdefd6d4e3efe48c8fb","head":{"label":"djs55:stupid-deadlock","ref":"stupid-deadlock","sha":"c4c9c78dd6f81522d6cebbdefd6d4e3efe48c8fb","user":{"login":"djs55","id":198586,"avatar_url":"https://avatars.githubusercontent.com/u/198586?v=3","gravatar_id":"","url":"https://api.github.com/users/djs55","html_url":"https://github.com/djs55","followers_url":"https://api.github.com/users/djs55/followers","following_url":"https://api.github.com/users/djs55/following{/other_user}","gists_url":"https://api.github.com/users/djs55/gists{/gist_id}","starred_url":"https://api.github.com/users/djs55/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djs55/subscriptions","organizations_url":"https://api.github.com/users/djs55/orgs","repos_url":"https://api.github.com/users/djs55/repos","events_url":"https://api.github.com/users/djs55/events{/privacy}","received_events_url":"https://api.github.com/users/djs55/received_events","type":"User","site_admin":false},"repo":{"id":45038596,"name":"ocaml-9p","full_name":"djs55/ocaml-9p","owner":{"login":"djs55","id":198586,"avatar_url":"https://avatars.githubusercontent.com/u/198586?v=3","gravatar_id":"","url":"https://api.github.com/users/djs55","html_url":"https://github.com/djs55","followers_url":"https://api.github.com/users/djs55/followers","following_url":"https://api.github.com/users/djs55/following{/other_user}","gists_url":"https://api.github.com/users/djs55/gists{/gist_id}","starred_url":"https://api.github.com/users/djs55/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djs55/subscriptions","organizations_url":"https://api.github.com/users/djs55/orgs","repos_url":"https://api.github.com/users/djs55/repos","events_url":"https://api.github.com/users/djs55/events{/privacy}","received_events_url":"https://api.github.com/users/djs55/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/djs55/ocaml-9p","description":"An OCaml/Mirage-friendly implementation of the 9P protocol","fork":true,"url":"https://api.github.com/repos/djs55/ocaml-9p","forks_url":"https://api.github.com/repos/djs55/ocaml-9p/forks","keys_url":"https://api.github.com/repos/djs55/ocaml-9p/keys{/key_id}","collaborators_url":"https://api.github.com/repos/djs55/ocaml-9p/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/djs55/ocaml-9p/teams","hooks_url":"https://api.github.com/repos/djs55/ocaml-9p/hooks","issue_events_url":"https://api.github.com/repos/djs55/ocaml-9p/issues/events{/number}","events_url":"https://api.github.com/repos/djs55/ocaml-9p/events","assignees_url":"https://api.github.com/repos/djs55/ocaml-9p/assignees{/user}","branches_url":"https://api.github.com/repos/djs55/ocaml-9p/branches{/branch}","tags_url":"https://api.github.com/repos/djs55/ocaml-9p/tags","blobs_url":"https://api.github.com/repos/djs55/ocaml-9p/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/djs55/ocaml-9p/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/djs55/ocaml-9p/git/refs{/sha}","trees_url":"https://api.github.com/repos/djs55/ocaml-9p/git/trees{/sha}","statuses_url":"https://api.github.com/repos/djs55/ocaml-9p/statuses/{sha}","languages_url":"https://api.github.com/repos/djs55/ocaml-9p/languages","stargazers_url":"https://api.github.com/repos/djs55/ocaml-9p/stargazers","contributors_url":"https://api.github.com/repos/djs55/ocaml-9p/contributors","subscribers_url":"https://api.github.com/repos/djs55/ocaml-9p/subscribers","subscription_url":"https://api.github.com/repos/djs55/ocaml-9p/subscription","commits_url":"https://api.github.com/repos/djs55/ocaml-9p/commits{/sha}","git_commits_url":"https://api.github.com/repos/djs55/ocaml-9p/git/commits{/sha}","comments_url":"https://api.github.com/repos/djs55/ocaml-9p/comments{/number}","issue_comment_url":"https://api.github.com/repos/djs55/ocaml-9p/issues/comments{/number}","contents_url":"https://api.github.com/repos/djs55/ocaml-9p/contents/{+path}","compare_url":"https://api.github.com/repos/djs55/ocaml-9p/compare/{base}...{head}","merges_url":"https://api.github.com/repos/djs55/ocaml-9p/merges","archive_url":"https://api.github.com/repos/djs55/ocaml-9p/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/djs55/ocaml-9p/downloads","issues_url":"https://api.github.com/repos/djs55/ocaml-9p/issues{/number}","pulls_url":"https://api.github.com/repos/djs55/ocaml-9p/pulls{/number}","milestones_url":"https://api.github.com/repos/djs55/ocaml-9p/milestones{/number}","notifications_url":"https://api.github.com/repos/djs55/ocaml-9p/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/djs55/ocaml-9p/labels{/name}","releases_url":"https://api.github.com/repos/djs55/ocaml-9p/releases{/id}","deployments_url":"https://api.github.com/repos/djs55/ocaml-9p/deployments","created_at":"2015-10-27T12:10:58Z","updated_at":"2016-01-20T18:35:26Z","pushed_at":"2016-07-12T13:23:50Z","git_url":"git://github.com/djs55/ocaml-9p.git","ssh_url":"git@github.com:djs55/ocaml-9p.git","clone_url":"https://github.com/djs55/ocaml-9p.git","svn_url":"https://github.com/djs55/ocaml-9p","homepage":null,"size":535,"stargazers_count":0,"watchers_count":0,"language":"OCaml","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":"mirage:master","ref":"master","sha":"8cfb469f4ff49d76e7904205f3ef4eb69b3cd525","user":{"login":"mirage","id":131943,"avatar_url":"https://avatars.githubusercontent.com/u/131943?v=3","gravatar_id":"","url":"https://api.github.com/users/mirage","html_url":"https://github.com/mirage","followers_url":"https://api.github.com/users/mirage/followers","following_url":"https://api.github.com/users/mirage/following{/other_user}","gists_url":"https://api.github.com/users/mirage/gists{/gist_id}","starred_url":"https://api.github.com/users/mirage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirage/subscriptions","organizations_url":"https://api.github.com/users/mirage/orgs","repos_url":"https://api.github.com/users/mirage/repos","events_url":"https://api.github.com/users/mirage/events{/privacy}","received_events_url":"https://api.github.com/users/mirage/received_events","type":"Organization","site_admin":false},"repo":{"id":43208262,"name":"ocaml-9p","full_name":"mirage/ocaml-9p","owner":{"login":"mirage","id":131943,"avatar_url":"https://avatars.githubusercontent.com/u/131943?v=3","gravatar_id":"","url":"https://api.github.com/users/mirage","html_url":"https://github.com/mirage","followers_url":"https://api.github.com/users/mirage/followers","following_url":"https://api.github.com/users/mirage/following{/other_user}","gists_url":"https://api.github.com/users/mirage/gists{/gist_id}","starred_url":"https://api.github.com/users/mirage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirage/subscriptions","organizations_url":"https://api.github.com/users/mirage/orgs","repos_url":"https://api.github.com/users/mirage/repos","events_url":"https://api.github.com/users/mirage/events{/privacy}","received_events_url":"https://api.github.com/users/mirage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mirage/ocaml-9p","description":"An OCaml/Mirage-friendly implementation of the 9P protocol","fork":false,"url":"https://api.github.com/repos/mirage/ocaml-9p","forks_url":"https://api.github.com/repos/mirage/ocaml-9p/forks","keys_url":"https://api.github.com/repos/mirage/ocaml-9p/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mirage/ocaml-9p/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mirage/ocaml-9p/teams","hooks_url":"https://api.github.com/repos/mirage/ocaml-9p/hooks","issue_events_url":"https://api.github.com/repos/mirage/ocaml-9p/issues/events{/number}","events_url":"https://api.github.com/repos/mirage/ocaml-9p/events","assignees_url":"https://api.github.com/repos/mirage/ocaml-9p/assignees{/user}","branches_url":"https://api.github.com/repos/mirage/ocaml-9p/branches{/branch}","tags_url":"https://api.github.com/repos/mirage/ocaml-9p/tags","blobs_url":"https://api.github.com/repos/mirage/ocaml-9p/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mirage/ocaml-9p/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mirage/ocaml-9p/git/refs{/sha}","trees_url":"https://api.github.com/repos/mirage/ocaml-9p/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mirage/ocaml-9p/statuses/{sha}","languages_url":"https://api.github.com/repos/mirage/ocaml-9p/languages","stargazers_url":"https://api.github.com/repos/mirage/ocaml-9p/stargazers","contributors_url":"https://api.github.com/repos/mirage/ocaml-9p/contributors","subscribers_url":"https://api.github.com/repos/mirage/ocaml-9p/subscribers","subscription_url":"https://api.github.com/repos/mirage/ocaml-9p/subscription","commits_url":"https://api.github.com/repos/mirage/ocaml-9p/commits{/sha}","git_commits_url":"https://api.github.com/repos/mirage/ocaml-9p/git/commits{/sha}","comments_url":"https://api.github.com/repos/mirage/ocaml-9p/comments{/number}","issue_comment_url":"https://api.github.com/repos/mirage/ocaml-9p/issues/comments{/number}","contents_url":"https://api.github.com/repos/mirage/ocaml-9p/contents/{+path}","compare_url":"https://api.github.com/repos/mirage/ocaml-9p/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mirage/ocaml-9p/merges","archive_url":"https://api.github.com/repos/mirage/ocaml-9p/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mirage/ocaml-9p/downloads","issues_url":"https://api.github.com/repos/mirage/ocaml-9p/issues{/number}","pulls_url":"https://api.github.com/repos/mirage/ocaml-9p/pulls{/number}","milestones_url":"https://api.github.com/repos/mirage/ocaml-9p/milestones{/number}","notifications_url":"https://api.github.com/repos/mirage/ocaml-9p/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mirage/ocaml-9p/labels{/name}","releases_url":"https://api.github.com/repos/mirage/ocaml-9p/releases{/id}","deployments_url":"https://api.github.com/repos/mirage/ocaml-9p/deployments","created_at":"2015-09-26T14:24:05Z","updated_at":"2016-06-30T18:58:21Z","pushed_at":"2016-07-12T13:24:16Z","git_url":"git://github.com/mirage/ocaml-9p.git","ssh_url":"git@github.com:mirage/ocaml-9p.git","clone_url":"https://github.com/mirage/ocaml-9p.git","svn_url":"https://github.com/mirage/ocaml-9p","homepage":null,"size":578,"stargazers_count":41,"watchers_count":41,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":11,"forks":8,"open_issues":11,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mirage/ocaml-9p/pulls/87"},"html":{"href":"https://github.com/mirage/ocaml-9p/pull/87"},"issue":{"href":"https://api.github.com/repos/mirage/ocaml-9p/issues/87"},"comments":{"href":"https://api.github.com/repos/mirage/ocaml-9p/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/mirage/ocaml-9p/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/mirage/ocaml-9p/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mirage/ocaml-9p/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/mirage/ocaml-9p/statuses/c4c9c78dd6f81522d6cebbdefd6d4e3efe48c8fb"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":2,"changed_files":1}}
{"actor":{"display_login":"djs55"}}