Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-warp for openSUSE:Factory 
checked in at 2021-06-23 17:38:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-warp (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-warp.new.2625 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-warp"

Wed Jun 23 17:38:28 2021 rev:8 rq:901461 version:3.3.17

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-warp/ghc-warp.changes        2021-06-01 
10:40:49.077155886 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-warp.new.2625/ghc-warp.changes      
2021-06-23 17:38:37.500503935 +0200
@@ -1,0 +2,9 @@
+Tue Jun 22 07:40:53 UTC 2021 - [email protected]
+
+- Update warp to version 3.3.17.
+  ## 3.3.17
+
+  * Modify exception handling to swallow async exceptions in forked thread 
[#850](https://github.com/yesodweb/wai/issues/850)
+  * Switch default forking function to not install the global exception 
handler (minor optimization) [#851](https://github.com/yesodweb/wai/pull/851)
+
+-------------------------------------------------------------------

Old:
----
  warp-3.3.16.tar.gz

New:
----
  warp-3.3.17.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-warp.spec ++++++
--- /var/tmp/diff_new_pack.NRcKDN/_old  2021-06-23 17:38:38.176504865 +0200
+++ /var/tmp/diff_new_pack.NRcKDN/_new  2021-06-23 17:38:38.176504865 +0200
@@ -19,7 +19,7 @@
 %global pkg_name warp
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        3.3.16
+Version:        3.3.17
 Release:        0
 Summary:        A fast, light-weight web server for WAI applications
 License:        MIT

++++++ warp-3.3.16.tar.gz -> warp-3.3.17.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-3.3.16/ChangeLog.md new/warp-3.3.17/ChangeLog.md
--- old/warp-3.3.16/ChangeLog.md        2021-05-26 07:02:00.000000000 +0200
+++ new/warp-3.3.17/ChangeLog.md        2021-06-22 02:13:49.000000000 +0200
@@ -1,5 +1,10 @@
 # ChangeLog for warp
 
+## 3.3.17
+
+* Modify exception handling to swallow async exceptions in forked thread 
[#850](https://github.com/yesodweb/wai/issues/850)
+* Switch default forking function to not install the global exception handler 
(minor optimization) [#851](https://github.com/yesodweb/wai/pull/851)
+
 ## 3.3.16
 
 * Move exception handling over to `unliftio` for better async exception 
support [#845](https://github.com/yesodweb/wai/issues/845)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-3.3.16/Network/Wai/Handler/Warp/Run.hs 
new/warp-3.3.17/Network/Wai/Handler/Warp/Run.hs
--- old/warp-3.3.16/Network/Wai/Handler/Warp/Run.hs     2021-05-26 
07:02:00.000000000 +0200
+++ new/warp-3.3.17/Network/Wai/Handler/Warp/Run.hs     2021-06-22 
02:13:49.000000000 +0200
@@ -9,6 +9,7 @@
 
 import Control.Arrow (first)
 import Control.Exception (allowInterrupt)
+import qualified Control.Exception
 import qualified UnliftIO
 import UnliftIO (toException)
 import qualified Data.ByteString as S
@@ -288,7 +289,12 @@
 fork set mkConn addr app counter ii = settingsFork set $ \unmask ->
     -- Call the user-supplied on exception code if any
     -- exceptions are thrown.
-    UnliftIO.handleAny (settingsOnException set Nothing) $
+    --
+    -- Intentionally using Control.Exception.handle, since we want to
+    -- catch all exceptions and avoid them from propagating, even
+    -- async exceptions. See:
+    -- https://github.com/yesodweb/wai/issues/850
+    Control.Exception.handle (settingsOnException set Nothing) $
         -- Run the connection maker to get a new connection, and ensure
         -- that the connection is closed. If the mkConn call throws an
         -- exception, we will leak the connection. If the mkConn call is
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-3.3.16/Network/Wai/Handler/Warp/Settings.hs 
new/warp-3.3.17/Network/Wai/Handler/Warp/Settings.hs
--- old/warp-3.3.16/Network/Wai/Handler/Warp/Settings.hs        2021-05-26 
07:02:00.000000000 +0200
+++ new/warp-3.3.17/Network/Wai/Handler/Warp/Settings.hs        2021-06-22 
02:13:49.000000000 +0200
@@ -1,10 +1,12 @@
 {-# LANGUAGE OverloadedStrings, ScopedTypeVariables, ViewPatterns #-}
 {-# LANGUAGE PatternGuards, RankNTypes #-}
 {-# LANGUAGE ImpredicativeTypes, CPP #-}
+{-# LANGUAGE MagicHash, UnboxedTuples #-}
 
 module Network.Wai.Handler.Warp.Settings where
 
-import Control.Concurrent (forkIOWithUnmask)
+import GHC.IO (unsafeUnmask, IO (IO))
+import GHC.Prim (fork#)
 import UnliftIO (SomeException, fromException)
 import qualified Data.ByteString.Char8 as C8
 import qualified Data.ByteString.Builder as Builder
@@ -63,7 +65,7 @@
       -- This may be useful if you need OS bound threads, or if
       -- you wish to develop an alternative threading model.
       --
-      -- Default: void . forkIOWithUnmask
+      -- Default: 'defaultFork'
       --
       -- Since 3.0.4
 
@@ -163,7 +165,7 @@
     , settingsFdCacheDuration = 0
     , settingsFileInfoCacheDuration = 0
     , settingsBeforeMainLoop = return ()
-    , settingsFork = void . forkIOWithUnmask
+    , settingsFork = defaultFork
     , settingsNoParsePath = False
     , settingsInstallShutdownHandler = const $ return ()
     , settingsServerName = C8.pack $ "Warp/" ++ showVersion Paths_warp.version
@@ -236,3 +238,18 @@
     responseBuilder H.internalServerError500
                     [(H.hContentType, "text/plain; charset=utf-8")]
                     $ "Exception: " <> Builder.stringUtf8 (show e)
+
+-- | Similar to @forkIOWithUnmask@, but does not set up the default exception 
handler.
+--
+-- Since Warp will always install its own exception handler in forked threads, 
this provides
+-- a minor optimization.
+--
+-- For inspiration of this function, see @rawForkIO@ in the @async@ package.
+--
+-- @since 3.3.17
+defaultFork :: ((forall a. IO a -> IO a) -> IO ()) -> IO ()
+defaultFork io =
+  IO $ \s0 ->
+    case (fork# (io unsafeUnmask) s0) of
+      (# s1, _tid #) ->
+        (# s1, () #)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/warp-3.3.16/warp.cabal new/warp-3.3.17/warp.cabal
--- old/warp-3.3.16/warp.cabal  2021-05-26 07:02:00.000000000 +0200
+++ new/warp-3.3.17/warp.cabal  2021-06-22 02:13:49.000000000 +0200
@@ -1,5 +1,5 @@
 Name:                warp
-Version:             3.3.16
+Version:             3.3.17
 Synopsis:            A fast, light-weight web server for WAI applications.
 License:             MIT
 License-file:        LICENSE

Reply via email to