{"action":"closed","issue":{"url":"https://api.github.com/repos/barrucadu/dejafu/issues/160","repository_url":"https://api.github.com/repos/barrucadu/dejafu","labels_url":"https://api.github.com/repos/barrucadu/dejafu/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/barrucadu/dejafu/issues/160/comments","events_url":"https://api.github.com/repos/barrucadu/dejafu/issues/160/events","html_url":"https://github.com/barrucadu/dejafu/issues/160","id":279672416,"number":160,"title":"Handling of masking vs async exceptions issue","user":{"login":"robinp","id":418830,"avatar_url":"https://avatars2.githubusercontent.com/u/418830?v=4","gravatar_id":"","url":"https://api.github.com/users/robinp","html_url":"https://github.com/robinp","followers_url":"https://api.github.com/users/robinp/followers","following_url":"https://api.github.com/users/robinp/following{/other_user}","gists_url":"https://api.github.com/users/robinp/gists{/gist_id}","starred_url":"https://api.github.com/users/robinp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robinp/subscriptions","organizations_url":"https://api.github.com/users/robinp/orgs","repos_url":"https://api.github.com/users/robinp/repos","events_url":"https://api.github.com/users/robinp/events{/privacy}","received_events_url":"https://api.github.com/users/robinp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-12-06T08:52:48Z","updated_at":"2017-12-08T07:07:40Z","closed_at":"2017-12-08T07:07:40Z","author_association":"NONE","body":"Hello - first of all, very nice package! Please help me understand a behavior I see:\r\n\r\n```haskell\r\ncase2 = do\r\n    s <- newMVar \"\"\r\n    pid <- forkN \"comp\" $ do\r\n        E.bracket (logg s 'A' >> return \"foo\")\r\n                  (\\_ -> logg s 'R')\r\n                  (\\_ -> logg s 'I')\r\n    logg s 'F'\r\n    forkN \"kill\" $ killThread pid\r\n    takeMVar s\r\n  where\r\n    logg s x = E.uninterruptibleMask_ $ modifyMVar_ s $ \\v -> return (x:v)\r\n```\r\nBasically what I expect to see is that if `A`cquire happens, then `R`elease also happens due to bracket. But I don't see that based on the result breakdown.\r\n\r\nSo I tried uninterruptibleMasking the logging to the MVar, in case it's an async exception delivery point - but it doesn't seem to change the results:\r\n\r\n```\r\n[fail] Consistent Result (checked: 24)     \r\n        \"F\" S0--------------------         \r\n          1: comp                          \r\n          2: kill                          \r\n                                                                                                                                                                                  \r\n        \"RIAF\" S0-------------P1-----S0-----P1-----------------------------------------------S0--                                                                            \r\n          1: comp                          \r\n          2: kill                          \r\n                                           \r\n        \"IAF\" S0------------------P1------------------------------------P0--          \r\n          1: comp                          \r\n          2: kill                                                                     \r\n                                                                                      \r\n        \"AF\" S0------------------P1--------------------P0--                           \r\n          1: comp                                                                     \r\n          2: kill   \r\n[snip]\r\n```\r\nBasically I didn't expect to see `IAF`. So the question is, why doesn't the release trigger in `bracket`? If it's due to interruptible MVar operation (which is an artifact of the test logging), why doesn't the uninterruptibleMask help?\r\n\r\nThank you!"}}
{"actor":{"display_login":"robinp"}}