Comments (3)
it seems like it should have to reraise the failure
The correct protocol for interruption is to clean resources and rethrow, never swallow a ThreadKilled. However, when I did the latest change to some of the relevant code (to not log ThreadKilled) I decided to not change the current behaviour for now, to avoid muddying the waters until we understand what's going on
from unison.
To be clear to those less familiar with the context, I think that @SystemFw is referring to changes that he made in the @unison/httpserver
library, not to the Unison language itself.
@SystemFw in cases like that, where it is at the top level of a forked thread, I don't know if there is really a better option. fork
only accepts {IO}
, not Exception
, and anything that bubbles up to the top of the fork is ultimately going to be ignored or just logged.
from unison.
I don't know if there is really a better option. fork only accepts {IO}, not Exception, and anything that bubbles up to the top of the fork is ultimately going to be ignored or just logged.
that's true, but if you see in the whole chain of calls from Tcp server and up there are quite a few places that call catchAll
before getting to the top of the thread.
Also, just repeating what I said on Slack wrt worst case scenario: in the current Unison model on the Haskell runtime there is no way to guarantee the release of something, if you’re unlucky enough.
The primitive is :
catchAll : '{IO, Exception} a ->{IO} Either Failure a
and so if you have
res = catchAll do something
!finalizer
and you are unlucky enough, something will terminate naturally, but then interruption will hit in between res
and !finalizer
, and finalization won’t run. You cannot prevent this in any way in Unison only, it simply lacks the relevant primitive from Haskell (mask
), whilst inheriting its super granular interruption semantics.
The situation is also complicated by what the scheme runtime does, and basically I have held back from designing proper semantics because my preliminary analysis is that supporting it on both the Haskell and the Scheme runtime is nigh impossible
from unison.
Related Issues (20)
- fix up udp tests
- more helpful error message for errors that occur when typechecking record field accessors
- Deduplicate "scratch.u" updates
- Nix flake is invalid
- Tidying up Contributor Branches view in Share HOT 2
- Improving the `move` experience with `moveTo` and `rename` commands HOT 1
- bundle launcher scripts for manual installs
- add lib install command HOT 1
- update to use Node.js 20: cachix/cachix-action@v12.
- values in watch expressions should not be addable to codebase
- confirm that `run.native` is visible
- confirm that #4844 and #4932 are known on Share
- Soft-hang isn't used if one thing doesn't fit
- elaborate the migration startup message HOT 2
- ucm 0.5.20 fails to start up via symlink
- proposed more ergonomic way of adding test docs
- misleading `merge` error message
- test failure watch expressions can get lost in the noise
- identify the code that is relying on `ApplicativeDo`
- include `ui` in generic launcher script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unison.