Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • testsuite/tests/rts/IOManager.hsc
    ... ... @@ -582,15 +582,15 @@ recvEmptyBufPtcl (EmptyBufPtcl sync) fd = do
    582 582
     -- just do simple blocking read\/write of bytes. So this should just be needed
    
    583 583
     -- at the far ends of the hops.
    
    584 584
     --
    
    585
    -data FullBufPtcl = FullBufPtcl !(TVar Bool) !Int -- wait milliseconds
    
    585
    +data FullBufPtcl = FullBufPtcl !(TVar Bool) !Int -- wait microseconds
    
    586 586
     
    
    587 587
     newFullBufPtcl :: Int -> IO FullBufPtcl
    
    588
    -newFullBufPtcl nhops = FullBufPtcl <$> newTVarIO False <*> pure waitms
    
    588
    +newFullBufPtcl nhops = FullBufPtcl <$> newTVarIO False <*> pure waitus
    
    589 589
       where
    
    590
    -    waitms = nhops * 100 --100ms per hop
    
    590
    +    waitus = nhops * 100 -- 100µs per hop: 'timeout' takes microseconds
    
    591 591
     
    
    592 592
     sendFullBufPtcl :: FullBufPtcl -> Fd -> Word8 -> IO ()
    
    593
    -sendFullBufPtcl ptcl@(FullBufPtcl sync _waitms) fd x = do
    
    593
    +sendFullBufPtcl ptcl@(FullBufPtcl sync _waitus) fd x = do
    
    594 594
         res <- writeByteNonBlocking fd x
    
    595 595
         case res of
    
    596 596
           Just () ->
    
    ... ... @@ -606,20 +606,21 @@ sendFullBufPtcl ptcl@(FullBufPtcl sync _waitms) fd x = do
    606 606
             sendFullBufPtcl ptcl fd x
    
    607 607
     
    
    608 608
     finishSendFullBufPtcl :: FullBufPtcl -> IO ()
    
    609
    -finishSendFullBufPtcl (FullBufPtcl sync _waitms) =
    
    609
    +finishSendFullBufPtcl (FullBufPtcl sync _waitus) =
    
    610 610
         atomically $ writeTVar sync True -- release reader to finish
    
    611 611
     
    
    612 612
     recvFullBufPtcl :: FullBufPtcl -> Fd -> IO (Maybe Word8)
    
    613
    -recvFullBufPtcl (FullBufPtcl sync waitms) fd = do
    
    613
    +recvFullBufPtcl ptcl@(FullBufPtcl sync waitus) fd = do
    
    614 614
         atomically $ readTVar sync >>= check
    
    615 615
         res <- readByteNonBlocking fd
    
    616 616
         case res of
    
    617
    -      Nothing -> fail "recvFullBufPtcl: unexpected blocking"
    
    617
    +      -- With copy hops in between, the far end can lag behind the sender.
    
    618
    +      Nothing -> threadWaitRead fd >> recvFullBufPtcl ptcl fd
    
    618 619
           Just Nothing  -> return Nothing
    
    619 620
           Just (Just x) -> do
    
    620 621
             traceIO ("recvFullBufPtcl: read byte '" ++ show x
    
    621 622
                                       ++ "' on fd " ++ show fd ++ ", now waiting")
    
    622
    -        _ <- timeout waitms $ atomically $ readTVar sync >>= check . not
    
    623
    +        _ <- timeout waitus $ atomically $ readTVar sync >>= check . not
    
    623 624
             return (Just x)
    
    624 625
     
    
    625 626
     
    

  • testsuite/tests/rts/all.T
    ... ... @@ -681,7 +681,7 @@ test('T23400', [], compile_and_run, ['-with-rtsopts -A8k'])
    681 681
     test('IOManager', [js_skip, when(arch('wasm32'), skip), when(opsys('mingw32'), skip),
    
    682 682
                        pre_cmd('$MAKE -s --no-print-directory IOManager.hs'),
    
    683 683
                        when(have_smp(), extra_ways(['threaded2'])),
    
    684
    -                   all_available_io_managers_except(['winio', 'mio'])],
    
    684
    +                   all_available_io_managers_except(['winio'])],
    
    685 685
                        compile_and_run, [''])
    
    686 686
     
    
    687 687
     test('T24142', [req_target_smp], compile_and_run, ['-threaded -with-rtsopts "-N2"'])