[GHC] #7599: timeout does not behave as expected

#7599: timeout does not behave as expected
----------------------------------------+-----------------------------------
Reporter: ique | Owner:
Type: bug | Status: new
Priority: normal | Component: libraries/base
Version: 7.6.1 | Keywords: System.Timeout timeout base-4.6
Os: MacOS X | Architecture: x86_64 (amd64)
Failure: Incorrect result at runtime | Blockedby:
Blocking: | Related:
----------------------------------------+-----------------------------------
In trying to debug an error I found using the MongoDB package (it was
refusing connections) I found what I believe is a bug with System.Timeout.
When connecting with connectTo I immediately get a handle, wrapped in
timeout with a positive timeout, it instantly returns Nothing. When using
a negative timeout (wait indefinitely) it instantly returns the proper
Handle.
Below is a minimal test-case that I ran in ghci.
Import System.Timeout
Import Network
timeout (-1) $ connectTo "127.0.0.1" (PortNumber 27017)
-- This returns: Just {handle:

#7599: timeout does not behave as expected ------------------------------------------+--------------------------------- Reporter: ique | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: libraries/base | Version: 7.6.1 Resolution: duplicate | Keywords: System.Timeout timeout base-4.6 Os: MacOS X | Architecture: x86_64 (amd64) Failure: Incorrect result at runtime | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ------------------------------------------+--------------------------------- Changes (by simonmar): * status: new => closed * difficulty: => Unknown * resolution: => duplicate Comment: `threadDelay` isn't working properly in GHCi in 7.6.1 on OS X (#7299), I think this is a symptom of the same problem. Please re-open if it still occurs after #7299 is fixed. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7599#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC