haskell / hie-bios

Set up a GHC API session for various Haskell Projects
https://hackage.haskell.org/package/hie-bios
BSD 3-Clause "New" or "Revised" License
181 stars 63 forks source link

Avoid deadlocks in multi-component support #416

Closed wz1000 closed 1 year ago

wz1000 commented 1 year ago

The logging library doesn't seem to like it when multiple logging actions are interleaved with each other, as can happen if we use unsafeInterleaveIO. This leads to a deadlock.

To work around this, introduce a CachedIO type so that we can explicitly control ordering of effects and avoid such situations where logging is interleaved.