No description
2967bfd083
Uses the fix mentioned by @arianvp in https://github.com/haskell-servant/servant/pull/425. See also https://github.com/haskell-servant/servant/issues/51#issuecomment-250737727 The cause of the issue very is similar to the issue described in this blog post: https://www.fpcomplete.com/blog/2016/06/async-exceptions-stm-deadlocks The main thread creates a waiter, creates an asynchronous callback which is called when the `readyState` of the request changes. When the readyState changes to 4, which means 'request finished', the waiter MVar is put. The main thread takes the MVar and continues to do stuff with the response. The problem is that the `readyState` can change to 4 more than once, for some reason. The second time this happens, the waiter MVar can be put again, since the main thread took it. The main thread, however, won't take it again. After all, it only needed to take the MVar once to know that the request was finished. The third time `readyState` is set to 4, the putMVar would block, causing the following exception to be thrown: ``` thread blocked indefinitely in an MVar operation ``` Since state 4 should really mean that the response is ready, it seems appropriate to decide that all changes of the state to 4 after the initial one can be safely ignored. |
||
---|---|---|
doc | ||
scripts | ||
servant | ||
servant-client | ||
servant-docs | ||
servant-foreign | ||
servant-js | ||
servant-server | ||
.gitignore | ||
.stylish-haskell.yaml | ||
.travis.yml | ||
CONTRIBUTING.md | ||
HLint.hs | ||
README.md | ||
servant.png | ||
sources.txt | ||
stack-ghc-7.8.4.yaml | ||
stack-ghc-8.0.1.yaml | ||
stack.yaml |
servant - A Type-Level Web DSL
Getting Started
We have a tutorial that introduces the core features of servant. After this article, you should be able to write your first servant webservices, learning the rest from the haddocks' examples.
The central documentation can be found here. Other blog posts, videos and slides can be found on the website.
If you need help, drop by the IRC channel (#servant on freenode) or mailing list.
Contributing
See CONTRIBUTING.md