yesodweb / wai

Haskell Web Application Interface
MIT License
834 stars 263 forks source link

Removing unliftio #1012

Closed kazu-yamamoto closed 2 weeks ago

kazu-yamamoto commented 2 weeks ago

This PR removes unliftio from WAI families. This is because TLS bye and network gracefulClose cannot used with bracket of unliftio.

In my field testing for a week, I have not found any problems. This PR is just to run CI.

kazu-yamamoto commented 2 weeks ago

@Vlix Thank you for reviewing. I don't want to use safe-exception as alternative unliftio. This is because each library has its own semantics which I don't understand completely. One example is timeout cannot be used in bracket of unliftio which suffered me very much. I would like to use only Control.Exception since it is well-documented and I know it well. Even we would adopt safe-exception, we cannot let all other libraries to introduce it. The mixed situation is anxious. I would like to set up a proper handler for Control.Exception even though it is boring. I believe it saves my time In the long run. I will check your comments above tomorrow.

Vlix commented 2 weeks ago

I would like to set up a proper handler for Control.Exception even though it is boring.

I can understand that. I'd argue that we should try to mimic what unliftio did and change it in the situations where the unliftio style is not what we want.

kazu-yamamoto commented 2 weeks ago

I remembered one this. So, I write this up just for record.

Some people believe that unliftio makes our libraries less-buggy. But the reality is that unliftio can introduce new bugs. An example is that unliftio made makeConn of warp-tls uninterruptible. The fix was 371279f.

Vlix commented 2 weeks ago

Aaaah, that's why!

Ok, so what I think we should probably do:

Adding comments at those sections describing why we're using regular Control.Exception.catch or uninterruptibleMask or whatever would also be good for posterity.