#2401: aborting an STM transaction should throw an exception
------------------------------------------+---------------------------------
Reporter: sclv | Owner:
Type: bug | Status: reopened
Priority: normal | Milestone: 6.14.1
Component: Runtime System | Version: 6.8.3
Resolution: | Keywords:
Difficulty: Unknown | Os: Unknown/Multiple
Testcase: | Architecture: Unknown/Multiple
Failure: Incorrect result at runtime |
------------------------------------------+---------------------------------
Changes (by simonmar):
* failure: None/Unknown => Incorrect result at runtime
* summary: unsafeIOToSTM discards exception handlers. => aborting an STM
transaction should throw an exception
* milestone: 6.10.1 => 6.14.1
Comment:
(changing the bug title to reflect the underlying problem)
Summary:
* the STM transaction might be in the middle of an `unsafePerformIO` when
it is aborted. The user has no control over this, since transactions
can be aborted by the RTS, and the use of `unsafePerformIO` might be in
a library somewhere.
* The IO in the library expects to be able to catch exceptions and clean
up
if it is interrupted, otherwise it might leave locks in place. Imagine
pulling on some lazy I/O during an STM transaction, for example.
As @sclv pointed out, we also need to fix
[[TicketQuery(id=2558|)]]
otherwise when the IO operation re-throws the abort exception, it will
throw it synchronously.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2401#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs