Giter Club home page Giter Club logo

Comments (3)

SystemFw avatar SystemFw commented on June 6, 2024 1

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.

ceedubs avatar ceedubs commented on June 6, 2024

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.

SystemFw avatar SystemFw commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.