{"action":"created","issue":{"url":"https://api.github.com/repos/yesodweb/wai/issues/691","repository_url":"https://api.github.com/repos/yesodweb/wai","labels_url":"https://api.github.com/repos/yesodweb/wai/issues/691/labels{/name}","comments_url":"https://api.github.com/repos/yesodweb/wai/issues/691/comments","events_url":"https://api.github.com/repos/yesodweb/wai/issues/691/events","html_url":"https://github.com/yesodweb/wai/issues/691","id":328151064,"node_id":"MDU6SXNzdWUzMjgxNTEwNjQ=","number":691,"title":"Closing listening socket never terminates","user":{"login":"basvandijk","id":576355,"node_id":"MDQ6VXNlcjU3NjM1NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/576355?v=4","gravatar_id":"","url":"https://api.github.com/users/basvandijk","html_url":"https://github.com/basvandijk","followers_url":"https://api.github.com/users/basvandijk/followers","following_url":"https://api.github.com/users/basvandijk/following{/other_user}","gists_url":"https://api.github.com/users/basvandijk/gists{/gist_id}","starred_url":"https://api.github.com/users/basvandijk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basvandijk/subscriptions","organizations_url":"https://api.github.com/users/basvandijk/orgs","repos_url":"https://api.github.com/users/basvandijk/repos","events_url":"https://api.github.com/users/basvandijk/events{/privacy}","received_events_url":"https://api.github.com/users/basvandijk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-05-31T14:00:47Z","updated_at":"2018-07-15T12:41:26Z","closed_at":"2018-07-15T12:41:26Z","author_association":"CONTRIBUTOR","body":"At work I noticed that I couldn't terminate my warp-based webservers. Fortunately systemd will kill the process after 1m and 30s however, I don't want to rely on that. I isolated the problem to the following small example program:\r\n\r\nhttps://github.com/basvandijk/warp-close-test\r\n\r\nNote how I use `setInstallShutdownHandler` to install a shutdown handler. The shutdown handler will install a signal handler to handle SIGTERM. The handler for SIGTERM will then try to close the listening socket. However this is where the problem is because the close operation never finishes, i.e. I never see \"Socket closed.\" being printed.\r\n\r\nIt would be great if somebody could reproduce this! When you have Nix installed you can just run `make`.\r\n\r\nI expect to see:\r\n\r\n```\r\n$ make\r\n...\r\nSending SIGTERM...\r\nReceived SIGTERM. Closing socket...\r\nSocket closed.\r\n```\r\n\r\nHowever I see:\r\n```\r\n$ make\r\n...\r\nSending SIGTERM...\r\nReceived SIGTERM. Closing socket...\r\nSending SIGKILL\r\n```\r\n* OS name and version\r\n\r\n```\r\n$ nixos-version \r\n18.03pre-git (Impala)\r\n```\r\n\r\n```\r\n$ uname -a\r\nLinux bassbox 4.9.101 #1-NixOS SMP Sat May 19 08:27:01 UTC 2018 x86_64 GNU/Linux\r\n```\r\n\r\n\r\n* The versions of tools you're using (e.g. `stack`, `ghc`).\r\n```\r\n$ cabal --version\r\ncabal-install version 2.0.0.1\r\ncompiled using version 2.0.1.0 of the Cabal library \r\n```\r\n\r\n* The versions of dependencies you're using\r\n\r\nI tested this from warp-3.0.13.1 to 3.2.22. I also tested this with `network-2.7.0.0`.\r\n\r\n```\r\n$ ghc-pkg list\r\n/nix/store/nj3ja270bd5qyvc87kmal9x7w1cjsmns-ghc-8.2.2-with-packages/lib/ghc-8.2.2/package.conf.d\r\n    Cabal-2.0.1.0\r\n    appar-0.1.4\r\n    array-0.5.2.0\r\n    async-2.1.1.1\r\n    attoparsec-0.13.2.2\r\n    auto-update-0.1.4\r\n    base-4.10.1.0\r\n    binary-0.8.5.1\r\n    blaze-builder-0.4.0.2\r\n    bsb-http-chunked-0.0.0.2\r\n    byteorder-1.0.4\r\n    bytestring-0.10.8.2\r\n    bytestring-builder-0.10.8.1.0\r\n    case-insensitive-1.2.0.10\r\n    containers-0.5.10.2\r\n    deepseq-1.4.3.0\r\n    directory-1.3.0.2\r\n    filepath-1.4.1.2\r\n    ghc-8.2.2\r\n    ghc-boot-8.2.2\r\n    ghc-boot-th-8.2.2\r\n    ghc-compact-0.1.0.0\r\n    ghc-prim-0.5.1.1\r\n    ghci-8.2.2\r\n    hashable-1.2.6.1\r\n    haskeline-0.7.4.0\r\n    hoopl-3.10.2.2\r\n    hpc-0.6.0.3\r\n    http-date-0.0.6.1\r\n    http-types-0.9.1\r\n    http2-1.6.3\r\n    integer-gmp-1.0.1.0\r\n    integer-logarithms-1.0.2\r\n    iproute-1.7.2\r\n    network-2.6.3.4\r\n    pretty-1.1.3.3\r\n    primitive-0.6.3.0\r\n    process-1.6.1.0\r\n    psqueues-0.2.5.0\r\n    random-1.1\r\n    rts-1.0\r\n    scientific-0.3.5.2\r\n    semigroups-0.18.4\r\n    simple-sendfile-0.2.27\r\n    stm-2.4.5.0\r\n    streaming-commons-0.1.19\r\n    template-haskell-2.12.0.0\r\n    terminfo-0.4.1.0\r\n    text-1.2.2.2\r\n    time-1.8.0.2\r\n    transformers-0.5.2.0\r\n    unix-2.7.2.2\r\n    unix-compat-0.5.0.1\r\n    unordered-containers-0.2.8.0\r\n    vault-0.3.1.0\r\n    wai-3.2.1.1\r\n    warp-3.2.22\r\n    word8-0.1.3\r\n    xhtml-3000.2.2\r\n    zlib-0.6.1.2\r\n```"},"comment":{"url":"https://api.github.com/repos/yesodweb/wai/issues/comments/405089501","html_url":"https://github.com/yesodweb/wai/issues/691#issuecomment-405089501","issue_url":"https://api.github.com/repos/yesodweb/wai/issues/691","id":405089501,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTA4OTUwMQ==","user":{"login":"basvandijk","id":576355,"node_id":"MDQ6VXNlcjU3NjM1NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/576355?v=4","gravatar_id":"","url":"https://api.github.com/users/basvandijk","html_url":"https://github.com/basvandijk","followers_url":"https://api.github.com/users/basvandijk/followers","following_url":"https://api.github.com/users/basvandijk/following{/other_user}","gists_url":"https://api.github.com/users/basvandijk/gists{/gist_id}","starred_url":"https://api.github.com/users/basvandijk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basvandijk/subscriptions","organizations_url":"https://api.github.com/users/basvandijk/orgs","repos_url":"https://api.github.com/users/basvandijk/repos","events_url":"https://api.github.com/users/basvandijk/events{/privacy}","received_events_url":"https://api.github.com/users/basvandijk/received_events","type":"User","site_admin":false},"created_at":"2018-07-15T12:41:26Z","updated_at":"2018-07-15T12:41:26Z","author_association":"CONTRIBUTOR","body":"This has been fixed in [network-2.6.3.6](http://hackage.haskell.org/package/network-2.6.3.6)."}}
{"actor":{"display_login":"basvandijk"}}