New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in warp-3.2.4 (vs 3.2.3) #526

Closed
sol opened this Issue Mar 30, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@sol
Contributor

sol commented Mar 30, 2016

The following program used to work with warp-3.2.3:

{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import           Control.Exception
import           System.Directory
import           Network.Wai
import           Network.HTTP.Types
import           Network.Wai.Handler.Warp (runSettingsSocket, defaultSettings)
import           Network.Socket

main :: IO ()
main = withApplication app

socketName :: String
socketName = ".sensei.sock"

socketAddr :: SockAddr
socketAddr = SockAddrUnix socketName

newSocket :: IO Socket
newSocket = socket AF_UNIX Stream 0

withSocket :: (Socket -> IO a) -> IO a
withSocket action = bracket newSocket close action

withApplication :: Application -> IO ()
withApplication application = withSocket $ \sock -> do
  bracket_ (bind sock socketAddr) (removeFile socketName) $ do
    listen sock maxListenQueue
    runSettingsSocket defaultSettings sock application

app :: Application
app _ = ($ responseLBS ok200 [(hContentType, "text/plain")] "foo\n")

With warp-3.2.4 it fails on the first request with:

setSocketOption: unsupported operation (Operation not supported)

You can use seito from hspec/sensei or curl --unix-socket .sensei.sock http://localhost/ with a recent version of curl to make a request.

git bisect says:

0156d8bdb2ad6adf3234208f99151ae5a3d2729e is the first bad commit
commit 0156d8bdb2ad6adf3234208f99151ae5a3d2729e
Author: Kazu Yamamoto <kazu@iij.ad.jp>
Date:   Wed Mar 2 16:20:40 2016 +0900

    disabling Nagle's algorithm again (#128)
@snoyberg

This comment has been minimized.

Member

snoyberg commented Mar 30, 2016

I just saw a test failure in Stackage for Scotty, presumably from this. I'm going to temporarily block this newer Warp version in Stackage Nightly.

snoyberg added a commit to commercialhaskell/stackage that referenced this issue Mar 30, 2016

@sol

This comment has been minimized.

Contributor

sol commented Mar 31, 2016

@snoyberg Can we also deprecate 3.2.4 on Hackage?

@snoyberg

This comment has been minimized.

Member

snoyberg commented Mar 31, 2016

I've set the appropriate preferred-versions to avoid 3.2.4.

On Thu, Mar 31, 2016 at 5:36 AM, Simon Hengel notifications@github.com
wrote:

@snoyberg https://github.com/snoyberg Can we also deprecate 3.2.4 on
Hackage?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#526 (comment)

@sol

This comment has been minimized.

Contributor

sol commented Apr 1, 2016

Thanks!

Sent from mobile

On 1 Apr 2016, at 1:04 AM, Michael Snoyman notifications@github.com wrote:

I've set the appropriate preferred-versions to avoid 3.2.4.

On Thu, Mar 31, 2016 at 5:36 AM, Simon Hengel notifications@github.com
wrote:

@snoyberg https://github.com/snoyberg Can we also deprecate 3.2.4 on
Hackage?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#526 (comment)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@kazu-yamamoto

This comment has been minimized.

Contributor

kazu-yamamoto commented Apr 6, 2016

@sol Does the patch above solve your problem?

@kazu-yamamoto

This comment has been minimized.

Contributor

kazu-yamamoto commented Apr 7, 2016

I confirmed with @sol's code by myself. I have released a new version. Enjoy.

snoyberg added a commit to commercialhaskell/stackage that referenced this issue Apr 7, 2016

bergmark added a commit to commercialhaskell/stackage that referenced this issue Apr 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment